From 88dc0e7cb68e5ce3158c653e1e7ceab51cd3dac7 Mon Sep 17 00:00:00 2001 From: Hendrych Date: Fri, 20 Dec 2024 13:35:07 +0100 Subject: [PATCH] Clean up. --- examples/adolc_example.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/adolc_example.jl b/examples/adolc_example.jl index 9b745f8a8..efc49bf47 100644 --- a/examples/adolc_example.jl +++ b/examples/adolc_example.jl @@ -4,13 +4,13 @@ using LinearAlgebra using Test ## Data setup -n = Int(100) +n = Int(10000) xpi = rand(n); total = sum(xpi); const xp = xpi ./ total; -f(x) = norm(x - xp)^2 +f(x) = sum(abs2, x-xp) println("Automatic differentiation") @@ -42,6 +42,8 @@ x_au, _, primal_au, dual_gap_au, _ = FrankWolfe.frank_wolfe( println("\nHandwritten Gradient") +f(x) = norm(x-xp)^2 + function grad!(storage, x) @. storage = 2 * (x - xp) return nothing