From ea354b6c2be37ee93c6f47f09bcf7454823e0e79 Mon Sep 17 00:00:00 2001 From: Aaron Fenyes Date: Sun, 7 Jul 2024 17:56:12 -0700 Subject: [PATCH] Randomize guess in gradient descent test Randomly perturb the pre-solved part of the guess, and randomly choose the unsolved part. --- .../gram-test/overlapping-pyramids.jl | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/engine-proto/gram-test/overlapping-pyramids.jl b/engine-proto/gram-test/overlapping-pyramids.jl index 1be29e7..97fc119 100644 --- a/engine-proto/gram-test/overlapping-pyramids.jl +++ b/engine-proto/gram-test/overlapping-pyramids.jl @@ -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)