@ChrisRackauckas,
I am running a UODE solver using Optimization.jl
per recommendation.
Here are a few lines from a larger code (I might construct a MWE later).
adtype = Optimization.AutoZygote()
# adtype = Optimization.AutoFiniteDiff()
# ERROR: Cannot find function signature. Must wait on Rackauckas
optf = Optimization.OptimizationFunction((x,p)->loss_neuralode(x), adtype)
# Componentarray is a projection operator
optprob = Optimization.OptimizationProblem(optf, ComponentVector{Float64}(ps_NN))
res1 = Optimization.solve(optprob, Adam(0.1), maxiters=200)
I get the error:
Chosen Optimizer: Adam{Float64}(0.1, (0.8999999761581421, 0.9990000128746033), 2.220446049250313e-16)
Stacktrace:
[1] __solve(::OptimizationProblem{true, OptimizationFunction{true, Optimization.AutoZygote, var"#24#25", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, ComponentVector{Float64, Vector{Float64}, Tuple{Axis{(coeffs = ViewAxis(1:20, ShapedAxis((10, 2), NamedTuple())),)}}}, SciMLBase.NullParameters, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::Adam{Float64}; kwargs::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:maxiters,), Tuple{Int64}}})
@ SciMLBase ~/.julia/packages/SciMLBase/QqtZA/src/solve.jl:177
[2] solve(::OptimizationProblem{true, OptimizationFunction{true, Optimization.AutoZygote, var"#24#25", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, ComponentVector{Float64, Vector{Float64}, Tuple{Axis{(coeffs = ViewAxis(1:20, ShapedAxis((10, 2), NamedTuple())),)}}}, SciMLBase.NullParameters, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::Adam{Float64}; kwargs::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:maxiters,), Tuple{Int64}}})
@ SciMLBase ~/.julia/packages/SciMLBase/QqtZA/src/solve.jl:88
[3] top-level scope
@ ~/src/2022/basic_UODE/custom_lux_layer/Lokta-Voltera_polylayer.jl:160
Adam{Float64}(0.1, (0.8999999761581421, 0.9990000128746033), 2.220446049250313e-16)
I looked at the Julia source code and found that the solve
function in SciMLBase.jl
is called:
# if no cache interface is supported at least the following method has to be defined
function __solve(prob::OptimizationProblem, alg, args...; kwargs...)
throw(OptimizerMissingError(alg))
end
Why is it that the Adam
algorithm is not recognized? While waiting for a response, I’ll work on a MWE. Thanks.