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

How to pass function that returns gradient to Nonconvex.jl #123

Closed
jonasmac16 opened this issue Sep 8, 2021 · 4 comments
Closed

How to pass function that returns gradient to Nonconvex.jl #123

jonasmac16 opened this issue Sep 8, 2021 · 4 comments

Comments

@jonasmac16
Copy link

Hi,
I am looking into linking Nonconvex.jl with GalacticOptim.jl. I was running into the issue that GalacticOptim takes care of the AD stuff for the optimisation problem but I couldn't see an easy way to pass this info into Nonconvex.jl. Is it possible or does the AD of the optimisation problem has to take place in Nonconvex.jl?

I hope my question is somewhat clear.

@mohamed82008
Copy link
Member

mohamed82008 commented Sep 8, 2021

Define a new callable struct GOFunction that wraps a function and GO's AD-backend. Define a chain rule for GOFunction to make use of GO's AD mechanism. Nonconvex will be calling Zygote on the top level but that's a very shallow layer over GO's AD which can be using anything.

@mohamed82008
Copy link
Member

I am closing this now for lack of activity.

@jonasmac16
Copy link
Author

Thanks for the pointer, I will have a try implementing this in the coming week. Do you mind if I tag you in the PR and get back to you if I have anymore questions?

@mohamed82008
Copy link
Member

Great, I don't mind at all!

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

2 participants