-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Mutating arrays is not supported when trying to calculate the derivative of a function #1425
Comments
Generally I would say that no, you can not differentiate through |
Thanks for the heads-up. Following this issue #953 the solution for my specific case ended up being changing This issue may keep raising as more people test different PINN architectures. Maybe it's worth adding some troubleshooting related to this on the limitations section of the documentation? |
I'm not sure what we would add! #953 seems to be somewhat different and the last few posts there don't even use
That's part of the problem, no two PINN-related issues seem to be alike so it's difficult to nail down what would be required to address all of them. For example, there was a Discourse thread last week about nested diff and PINNs, but the formulation there is totally different from the one you presented here. That's why I recommended seeking help on SciML channels. They have the most experience out of anyone in the Julia community when it comes to working with AD for PINNs, and should be able to provide concrete advice on how to make your code work. You might be able to get a little more help here, but it'll be on the level of #953 instead of PINN-specific. |
Thanks for the input. That discourse thread is a great illustration of how difficult this is from the engineering standpoint that we users aren't always able to grasp |
I have a problem where I am trying to optimize the derivative of a function. The derivative of the function is calculated using the
jacobian
function in Zygote. When I try to run this MWE:Yields the following error
If I just try to run
dfdt(t) = jacobian(x->f(p,x),t)[1]
, it works as expected. The problem arises when it is passed through the Optimization problem.Is there any solution/workaround to have a loss function that involves the jacobian of the neural network?
The text was updated successfully, but these errors were encountered: