You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried using static vectors for parameters, which works nicely. But not when combined with autodiff:
julia>using Optimization, OptimizationOptimJL, StaticArrays, ForwardDiff
# don't specify inplace/outofplace:
julia> of =OptimizationFunction((x, p) ->sum(x), Optimization.AutoForwardDiff())
julia> prob =OptimizationProblem(of, SVector(0., 0.), nothing)
julia>solve(prob, Optim.GradientDescent())
ERROR:setindex!(::SVector{2, Float64}, value, ::Int) is not defined.
# specify out of place:
julia> of =OptimizationFunction{false}((x, p) ->sum(x), Optimization.AutoForwardDiff())
julia> prob =OptimizationProblem(of, SVector(0., 0.), nothing)
julia>solve(prob, Optim.GradientDescent())
ERROR: Use OptimizationFunction to pass the derivatives or automatically generate them with one of the autodiff backends
Is this expected?
The text was updated successfully, but these errors were encountered:
The ForwardDiff support for StaticArrays need to avoid the mutable DiffResults that we currently have it setup with. So I guess it's expected in that, now that you have mentioned it in an issue, I can see why it fails. Though I think it was just untested before. Not hard to fix though, but needs the effort.
I tried using static vectors for parameters, which works nicely. But not when combined with autodiff:
Is this expected?
The text was updated successfully, but these errors were encountered: