diff --git a/src/optimise/train.jl b/src/optimise/train.jl index b2631b23..a3af8d66 100644 --- a/src/optimise/train.jl +++ b/src/optimise/train.jl @@ -34,7 +34,7 @@ The callback can return `:stop` to interrupt the training loop. Multiple optimisers and callbacks can be passed to `opt` and `cb` as arrays. """ function train!(loss, data, opt; cb = () -> ()) - cb = try: + cb = try runall(cb) catch e if e isa StopException || rethrow()