File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
lib/OptimizationOptimisers/src Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,19 @@ function SciMLBase.__solve(cache::OptimizationCache{
5959 else
6060 cache. solver_args. epochs
6161 end
62+ maxiters = if cache. solver_args. maxiters === nothing
63+ if cache. solver_args. epochs === nothing
64+ throw (ArgumentError (" The number of iterations must be specified with either the epochs or maxiters kwarg. Where maxiters = epochs*length(data)." ))
65+ else
66+ cache. solver_args. epochs * length (data)
67+ end
68+ else
69+ cache. solver_args. maxiters
70+ end
6271
6372 epochs = Optimization. _check_and_convert_maxiters (epochs)
64- if epochs === nothing
73+ maxiters = Optimization. _check_and_convert_maxiters (maxiters)
74+ if epochs === nothing || maxiters === nothing
6575 throw (ArgumentError (" The number of iterations must be specified with either the epochs or maxiters kwarg. Where maxiters = epochs*length(data)." ))
6676 end
6777
You can’t perform that action at this time.
0 commit comments