Sketch backtracking Newton's method

This code is a mess, but I'm committing it to record a working state
before I start trying to clean up.
This commit is contained in:
Aaron Fenyes 2024-07-15 11:32:04 -07:00
parent 3910b9f740
commit 25b09ebf92
4 changed files with 254 additions and 8 deletions

View file

@ -81,16 +81,23 @@ guess = hcat(
=#
# complete the gram matrix using gradient descent followed by Newton's method
#=
L, history = Engine.realize_gram_gradient(gram, guess, scaled_tol = 0.01)
L_pol, history_pol = Engine.realize_gram_newton(gram, L, rate = 0.3, scaled_tol = 1e-9)
L_pol2, history_pol2 = Engine.realize_gram_newton(gram, L_pol)
=#
L, history = Engine.realize_gram(Float64.(gram), Float64.(guess))
completed_gram = L'*Engine.Q*L
println("Completed Gram matrix:\n")
display(completed_gram)
#=
println(
"\nSteps: ",
size(history.scaled_loss, 1),
" + ", size(history_pol.scaled_loss, 1),
" + ", size(history_pol2.scaled_loss, 1)
)
println("Loss: ", history_pol2.scaled_loss[end], "\n")
println("Loss: ", history_pol2.scaled_loss[end], "\n")
=#
println("\nSteps: ", size(history.scaled_loss, 1))
println("Loss: ", history.scaled_loss[end], "\n")