Skip to content
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

Autodiff gradients for parameters error #75

Closed
lindnemi opened this issue Mar 10, 2021 · 1 comment
Closed

Autodiff gradients for parameters error #75

lindnemi opened this issue Mar 10, 2021 · 1 comment

Comments

@lindnemi
Copy link
Collaborator

https://github.com/PIK-ICoN/NetworkDynamics.jl/blob/master/test/autodiff_test.jl

I don't know why ReverseDiff started throwing an error as well, but it does now. The problem seems to be for ForwardDiff, as well as for ReverseDiff, that the Tracked resp. Dual numbers can't be stored in our internal caches because of type mismatch.

An idea would be to dispatch on parameter type in prep_gd, and change the types of the buffers. However, the tuple syntax means that we would have to dispatch on many different possibilites. Hence, fixing this should be combined with #34.

@lindnemi
Copy link
Collaborator Author

Forget what I said. The problem is solved by initializing the output array with the correct type (matching the type of the parameters). All autodiff tests pass now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant