fixed throwing exception
This commit is contained in:
parent
887bfad312
commit
2aa057ec08
@ -36,8 +36,8 @@ Multiple optimisers and callbacks can be passed to `opt` and `cb` as arrays.
|
||||
function train!(loss, data, opt; cb = () -> ())
|
||||
cb = try
|
||||
runall(cb)
|
||||
catch e
|
||||
if e isa StopException || rethrow(e)
|
||||
catch ex
|
||||
if ex isa StopException || rethrow(ex)
|
||||
@info "Stop Condition Met"
|
||||
return :stop
|
||||
opt = runall(opt)
|
||||
|
@ -157,5 +157,5 @@ end
|
||||
struct StopException <: Exception end
|
||||
|
||||
function stop()
|
||||
throw(StopException)
|
||||
throw(StopException())
|
||||
end
|
Loading…
Reference in New Issue
Block a user