-
Notifications
You must be signed in to change notification settings - Fork 756
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
Add NNCG to optimizers submodule #1661
base: master
Are you sure you want to change the base?
Conversation
Format the code using black https://github.com/psf/black |
I've formatted the code with black in the latest commit! |
If this only supports pytorch, then it should be in https://github.com/lululxvi/deepxde/tree/master/deepxde/optimizers/pytorch |
Moved to the right folder! |
Made the formatting changes. I noticed there are other lines in the code with > 88 chars per line. Would you like for me to fix those? |
Yes. Could you also fix the Codacy issues? |
The formatting has been fixed. There are still some Codacy issues, but these are mainly due to "too many local variables" and the What do we need do next to further integrate NNCG into the codebase? |
Need to add the NNCG to https://github.com/lululxvi/deepxde/blob/master/deepxde/optimizers/pytorch/optimizers.py |
I've added NNCG to optimizers.py and NNCG_options to config.py |
Fixed! |
Fixed! |
Have you tried using NNCG in some demo examples? |
A quick update: I've started thinking about how to make a demo example that uses NNCG. The plan would be to modify some of the existing examples (e.g. Burgers.py) and add on NNCG after Adam and L-BFGS. I'll have to make some modifications to model.py to full integrate NNCG into the training pipeline. I'm aiming to have an example fully working by the end of next week! |
@lululxvi My apologies for taking so long. I've updated the code -- I moved most of the complexity from The main thing to note is that I added an argument
Let me know if you'd like for me to make more changes -- I'd be interested in knowing if the tutorial The errors in the Codacy analysis are from |
Could you fix the other Codacy issues of dict and super-with-arguments? |
@lululxvi I've removed the unnecessary error checking and fixed the Codacy issues of dict and super-with-arguments. |
@lululxvi Made the changes. Should we consider merging |
@lululxvi I added a Thanks for your patience with the refactoring steps so far! |
@lululxvi Done! |
Add a document for the example similar to this https://deepxde.readthedocs.io/en/latest/demos/pinn_forward/burgers.html |
@lululxvi I added the demo. It's basically the same as the one you linked, except I added the part with NNCG to the end. Is there a way to check if it's been properly integrated into the docs? |
Please resolve the conflict. You can look at the generated doc by clicking "Details" at the right side of "docs/readthedocs.org:deepxde" in in the check list. |
@lululxvi I've fixed the merge conflict! I took a look at the doc for the demo, and it seems good to me. |
@@ -0,0 +1,73 @@ | |||
"""Backend supported: pytorch""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking if it is possible/better to combine this file with the existing Buerger file. Would this be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you that there is a lot of similarity between Burgers_NNCG.py
and Burgers.py
.
However, if we combine Burgers_NNCG.py
with Burgers.py
, we would limit Burgers.py
to only the PyTorch backend, no?
Also, NNCG is a bit slower than the other optimizers, so this could be frustrating for a practitioner who wants to run a simple demo.
Let me know what you think!
No description provided.