Skip to content

Commit

Permalink
use callback to terminate minibatch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavdixit02 committed Sep 14, 2024
1 parent 2a803ff commit c012905
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/minibatch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end

function callback(state, l) #callback function to observe training
display(l)
return false
return l < 1e-3
end

u0 = Float32[200.0]
Expand Down Expand Up @@ -100,7 +100,7 @@ function callback(st, l, pred; doplot = false)
scatter!(pl, t, pred[1, :], label = "prediction")
display(plot(pl))
end
return false
return l < 1e-3
end

optfun = OptimizationFunction(loss_adjoint,
Expand Down

0 comments on commit c012905

Please sign in to comment.