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