File tree 1 file changed +11
-1
lines changed
lib/OptimizationOptimisers/src
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{
59
59
else
60
60
cache. solver_args. epochs
61
61
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
62
71
63
72
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
65
75
throw (ArgumentError (" The number of iterations must be specified with either the epochs or maxiters kwarg. Where maxiters = epochs*length(data)." ))
66
76
end
67
77
You can’t perform that action at this time.
0 commit comments