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

Optimize all parameters in Pytorch module that require gradient #1602

Open
JackCaster opened this issue Mar 18, 2024 · 1 comment
Open

Optimize all parameters in Pytorch module that require gradient #1602

JackCaster opened this issue Mar 18, 2024 · 1 comment

Comments

@JackCaster
Copy link

I would like to optimize a Pytorch neural network with Nevergrad. How can I tell Nevergrad to optimize all parameters in the module that require grad (e.g., params_to_optimize = filter(lambda p: p.requires_grad, model.parameters()))?

@changdaeoh
Copy link

@JackCaster Hi

It's been a while, so you've probably resolved it on your own, but I found the tutorial below useful.

https://medium.com/@joragasy/optimize-neural-network-with-gradient-free-methods-using-pytorch-and-nevergrad-399a9f4a5c21

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