Use Newton's method for polishing
This commit is contained in:
parent
d538cbf716
commit
3910b9f740
4 changed files with 103 additions and 18 deletions
|
@ -1,8 +1,6 @@
|
|||
include("Engine.jl")
|
||||
|
||||
using SparseArrays
|
||||
using AbstractAlgebra
|
||||
using PolynomialRoots
|
||||
using Random
|
||||
|
||||
# initialize the partial gram matrix for a sphere inscribed in a regular
|
||||
|
@ -35,10 +33,10 @@ guess = sqrt(1/BigFloat(3)) * BigFloat[
|
|||
1 1 1 1 1
|
||||
] + 0.2*Engine.rand_on_shell(fill(BigFloat(-1), 5))
|
||||
|
||||
# complete the gram matrix using gradient descent
|
||||
L, history = Engine.realize_gram(gram, guess)
|
||||
# complete the gram matrix using Newton's method
|
||||
L, history = Engine.realize_gram_newton(gram, guess)
|
||||
completed_gram = L'*Engine.Q*L
|
||||
println("Completed Gram matrix:\n")
|
||||
display(completed_gram)
|
||||
println("\nSteps: ", size(history.stepsize, 1))
|
||||
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