Closed aplavin closed 7 months ago
Thanks for reporting! I haven't encountered methods that don't support parameter bounds, but Newton
is such.
Fixed: now, you can just omit interval bounds from OptArgs
, specifying only optics.
Also, to make your example work, one needs a mutable vector (not SVector), and provide derivatives. Both are requirements of Newton
.
julia> using AccessibleOptimization, OptimizationOptimJL, StaticArrays, IntervalSets
julia> struct Flat{T}
val::T
end
julia> d = [4.0,6.0]
julia> v = OptArgs(
@optic(_.val),
)
julia> l(m, data) = sum(obs -> abs2(m.val - obs), data)
julia> ops = OptProblemSpec(Base.Fix2(OptimizationFunction(l, Optimization.AutoForwardDiff()), d), Vector, Flat(0.0), v)
julia> solve(ops, Newton()).uobj
Flat{Float64}(5.0)
In GitLab by @alecloudenback on Jun 14, 2023, 10:19
If changing the example in the sample notebook from
ECA()
toNewton()
(fromOptimizaitonOptimJL
), one gets the error:Even when limiting the model and
OptArgs
to one parameter, the error persists.MWE: