File tree 1 file changed +8
-2
lines changed
lib/OptimizationOptimisers/src
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,16 @@ function SciMLBase.__solve(cache::OptimizationCache{
52
52
dataiterate = false
53
53
end
54
54
55
- epochs, maxiters = if isnothing (cache. solver_args. maxiters) ==
55
+ epochs, maxiters = if isnothing (cache. solver_args. maxiters) &&
56
56
isnothing (cache. solver_args. epochs)
57
- # both of them are `nothing` or have a value
58
57
throw (ArgumentError (" The number of iterations must be specified with either the epochs or maxiters kwarg. Where maxiters = epochs * length(data)." ))
58
+ elseif ! isnothing (cache. solver_args. maxiters) &&
59
+ ! isnothing (cache. solver_args. epochs)
60
+ if cache. solver_args. maxiters == cache. solver_args. epochs * length (data)
61
+ cache. solver_args. epochs, cache. solver_args. maxiters
62
+ else
63
+ throw (ArgumentError (" The number of iterations must be specified with either the epochs or maxiters kwarg. Where maxiters = epochs * length(data)." ))
64
+ end
59
65
elseif isnothing (cache. solver_args. maxiters)
60
66
cache. solver_args. epochs, cache. solver_args. epochs * length (data)
61
67
elseif isnothing (cache. solver_args. epochs)
You can’t perform that action at this time.
0 commit comments