Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrych committed Dec 20, 2024
1 parent f265da6 commit 88dc0e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/adolc_example.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 88dc0e7

Please sign in to comment.