-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for ComponentArrays #240
Comments
It seems to not be working for me: using LsqFit
using ComponentArrays
using Parameters: @unpack
# solve J=1/2x^2+1/2y^2 subject to x + y = 2
function root!(z, ignored, u)
println(u)
@unpack x, y, λ = u
z.∂L∂λ = x + y - 2.0
z.∂L∂x = x - λ
z.∂L∂y = y - λ
println(z)
return nothing
end
u0 = ComponentArray(x = 0.0, y = 0.0, λ = 0.0)
z = ComponentArray(∂L∂λ = 0.0, ∂L∂x = 0.0, ∂L∂y = 0.0)
sol = curve_fit(root!, [0.0], z, u0; inplace=true) that throws in FiniteDiff.jl, I also get a failure by adding
|
The error when using ForwardDiff.jl:
|
If you give me an example of a model and the input you want to give, I can have a look. |
is it possible to support componet array for parameters?
if i have variable number of parameters, it will be diffucult to track their positions.
It will be nice if i make p0 a component array and get optimized param with same shape.
The text was updated successfully, but these errors were encountered: