Skip to content

Commit

Permalink
fix errs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavdixit02 committed Jan 4, 2024
1 parent bf77f69 commit 34bff41
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/OptimizationOptimisers/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ using Zygote

prob = OptimizationProblem(optprob, x0, _p)
function callback(state, l)
Optimisers.adjust!(state.solver_state, 0.1/state.iter)
Optimisers.adjust!(state.solver_state, 0.1/state.iteration)
return false
end
sol = solve(prob, Optimisers.Adam(0.1), maxiters = 1000, progress = false, callback = callback)
Expand Down
6 changes: 2 additions & 4 deletions test/diffeqfluxtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ function loss_adjoint(p)
end

iter = 0
callback = function (p, l, pred)
global iter
iter += 1
callback = function (state, l, pred)

display(l)

# using `remake` to re-create our `prob` with current parameters `p`
remade_solution = solve(remake(prob_ode, p = p), Tsit5(), saveat = tsteps)
remade_solution = solve(remake(prob_ode, p = state.u), Tsit5(), saveat = tsteps)

# Tell sciml_train to not halt the optimization. If return true, then
# optimization stops.
Expand Down
2 changes: 1 addition & 1 deletion test/minibatch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function dudt_(u, p, t)
ann(u, p, st)[1] .* u
end

callback = function (p, l, pred, args...; doplot = false) #callback function to observe training
callback = function (state, l, pred, args...; doplot = false) #callback function to observe training
display(l)
# plot current prediction against data
if doplot
Expand Down

0 comments on commit 34bff41

Please sign in to comment.