forked from StudioInfinity/dyna3
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:
parent
3910b9f740
commit
25b09ebf92
4 changed files with 254 additions and 8 deletions
|
@ -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")
|
Loading…
Add table
Add a link
Reference in a new issue