diff --git a/engine-proto/gram-test/Engine.jl b/engine-proto/gram-test/Engine.jl index e8bda9c..2fb41e0 100644 --- a/engine-proto/gram-test/Engine.jl +++ b/engine-proto/gram-test/Engine.jl @@ -104,7 +104,7 @@ function realize_gram( # do gradient descent Δ_proj = proj_diff(gram, L'*Q*L) - loss = norm(Δ_proj) + loss = dot(Δ_proj, Δ_proj) for step in 1:max_descent_steps # stop if the loss is tolerably low if loss < tol @@ -128,7 +128,7 @@ function realize_gram( history.stepsize[end] = stepsize L = L_last + stepsize * neg_grad Δ_proj = proj_diff(gram, L'*Q*L) - loss = norm(Δ_proj) + loss = dot(Δ_proj, Δ_proj) improvement = loss_last - loss if improvement >= target_improvement * stepsize * slope history.backoff_steps[end] = backoff_steps