Skip to content

Commit

Permalink
fix failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavdixit02 committed Dec 27, 2023
1 parent 43abb68 commit 7f2f357
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/OptimizationOptimisers/src/OptimizationOptimisers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ function SciMLBase.__solve(cache::OptimizationCache{
cache.progress && ProgressLogging.@logprogress msg i/maxiters

if cache.solver_args.save_best
if first(x)[1] < first(min_err) #found a better solution
if first(x)[1] < first(min_err)[1] #found a better solution
min_opt = opt
min_err = x[1]
min_err = x
min_θ = copy(θ)
end
if i == maxiters #Last iteration, revert to best.
Expand All @@ -93,7 +93,7 @@ function SciMLBase.__solve(cache::OptimizationCache{

t1 = time()

SciMLBase.build_solution(cache, cache.opt, θ, x[1], solve_time = t1 - t0)
SciMLBase.build_solution(cache, cache.opt, θ, first(x)[1], solve_time = t1 - t0)
# here should be build_solution to create the output message
end

Expand Down
2 changes: 1 addition & 1 deletion test/diffeqfluxtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function loss_neuralode(p)
end

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

Expand Down

0 comments on commit 7f2f357

Please sign in to comment.