Skip to content

Commit

Permalink
Fewer points, more iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Mar 18, 2024
1 parent b557c61 commit 005eb7f
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@ const SUITE = BenchmarkGroup()

# Example function to optimize
function gabor(x, phi)
# Example from Prince, 2023
return (
sin(phi[1] + 0.06 * phi[2] * x)
*
exp(-(phi[1] + 0.06 * phi[1] * x)^2 / 32.0)
)
# Optimization example from "Understanding Deep Learning"; Prince, 2023
return sin(phi[1] + 0.06 * phi[2] * x) * exp(-(phi[1] + 0.06 * phi[1] * x)^2 / 32.0)
end

tests = (;
first_order=(;
loss_generator=(X, Y) -> (phi -> sum(i -> (gabor(X[i], phi) - Y[i])^2, eachindex(X, Y))),
init_phi=() -> [1.0, 6.0],
true_phi=() -> [0.0, 16.6],
domain=() -> LinRange(-15.0, 15.0, 256),
options=() -> Optim.Options(iterations=10),
domain=() -> LinRange(-15.0, 15.0, 64),
options=() -> Optim.Options(iterations=100),
optimizers=[
:Adam,
:AdaMax,
Expand Down

0 comments on commit 005eb7f

Please sign in to comment.