Randomize guess in gradient descent test
Randomly perturb the pre-solved part of the guess, and randomly choose the unsolved part.
This commit is contained in:
parent
d39244d308
commit
ea354b6c2b
@ -3,6 +3,7 @@ include("Engine.jl")
|
||||
using SparseArrays
|
||||
using AbstractAlgebra
|
||||
using PolynomialRoots
|
||||
using Random
|
||||
|
||||
# initialize the partial gram matrix for an arrangement of seven spheres in
|
||||
# which spheres 1 through 5 are mutually tangent, and spheres 3 through 7 are
|
||||
@ -34,13 +35,17 @@ gram[1, 6] = gram[6, 1]
|
||||
|
||||
# in this initial guess, the mutual tangency condition is satisfied for spheres
|
||||
# 1 through 5
|
||||
guess = sqrt(1/BigFloat(2)) * BigFloat[
|
||||
1 1 -1 -1 0 -0.1 0.3;
|
||||
1 -1 1 -1 0 -0.5 0.4;
|
||||
1 -1 -1 1 0 0.1 -0.2;
|
||||
0 0 0 0 -sqrt(BigFloat(6)) 0.3 -0.2;
|
||||
1 1 1 1 2 0.2 0.1;
|
||||
]
|
||||
Random.seed!(50793)
|
||||
guess = hcat(
|
||||
sqrt(1/BigFloat(2)) * BigFloat[
|
||||
1 1 -1 -1 0;
|
||||
1 -1 1 -1 0;
|
||||
1 -1 -1 1 0;
|
||||
0 0 0 0 -sqrt(BigFloat(6));
|
||||
1 1 1 1 2;
|
||||
] + 0.2*Engine.rand_on_shell(fill(BigFloat(-1), 5)),
|
||||
Engine.rand_on_shell(fill(BigFloat(-1), 2))
|
||||
)
|
||||
|
||||
# complete the gram matrix using gradient descent
|
||||
L, history = Engine.realize_gram(gram, guess)
|
||||
|
Loading…
Reference in New Issue
Block a user