-
Notifications
You must be signed in to change notification settings - Fork 92
Update tutorials 1-12 to current version (no Plotter) #463
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
Conversation
MatteB03
commented
Feb 26, 2025
- Changed imports to match current folders
- Changed notation where version differed from master
- Deleted unnecessary inputs and modified outdated ones
- Minor changes to solve tutorial-specific errors
- Accordingly changed tutorial.py files
- Added tmp_poisson_inverse folder in tutorial7 to store epochs log
dario-coscia
left a comment
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.
Hi! Thank you for updating the tutorials, it is really an incredible work :) I have made few comments on the PR, in particular the missing plots and some others. For plotting the solution you can use matplotlib, while for the loss the tensorboard extension should be fine.
| """ | ||
| # initialize to all zeros | ||
| tmp = torch.zeros_like(X) | ||
| tmp = torch.zeros_like(X).as_subclass(torch.Tensor) |
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.
remove this, and use use_lt=False
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.
So, this block should work only without LabelTensor? I did this to make compatible both with and without LabelTensor
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.
all blocks should work with both, if it is needed ok!
tutorials/tutorial1/tutorial.py
Outdated
|
|
||
| pl = Plotter() | ||
| pl.plot_samples(problem=problem) | ||
| #pl = Plotter() |
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.
we should be able to plot the solution, please do the plot with matplotlib
tutorials/tutorial14/tutorial.py
Outdated
| get_ipython().run_line_magic('matplotlib', 'inline') | ||
|
|
||
| import matplotlib.pyplot as plt | ||
| plt.style.use('tableau-colorblind10') |
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.
Maybe we should use the same palette in every tutorial for consistency. We can think of having a PINA palette but maybe we can do it in a second iteration.
tutorials/tutorial14/tutorial.py
Outdated
| # In[2]: | ||
|
|
||
|
|
||
| get_ipython().system('pip install git+https://github.com/mathLab/Smithers.git #if required --break-system-packages') |
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.
Let's remove this, maybe we can create optional dependencies for pina tutorials (see here)
|
Also @MatteB03 and @FilippoOlivo there are conflicts to be solver inside |
|
@MatteB03 how are you doing with this? Should we convert it as draft? |
Aside from tutorials 2 and 13 everything else works, if I revert tutorial 2 and keep working on those on my local could we still update everything else? |
Also, I think the issue in tutorial2 is the same as in tutorial13... the phys_loss and train_loss are very high while the bound_losses are low, similar to what we marked as bug in tutorial13. Did you get what the bug was? |
409f56d to
782194e
Compare
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.
Please @MatteB03, remove folder tutorial/tutorial4/data. @dario-coscia, should we update .gitignore to prevent this behavior in the future?
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.
Tutorial10 also has data, although the folder is created in the initial imports. @FilippoOlivo want me to delete that as well?
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.
No, they must be there
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.
Does tutorial 4 requires data?
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.
Yes, MNIST but it is available in torchvision
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.
Yes, it's the one that takes MNIST from Torchvision. The data is saved while being downloaded, I can try to look up a way to prevent this or to erase the folder automatically if u want
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.
Just deleting the folder is fine for me. Saving data locally is the correct approach, but we don’t want to upload it to PINA
|
Also, I just saw a strange thing... On every epoch of training the train function prints |
|
Sorry guys, the strange behaviour with the validation print keeps happening even after rebasing everything up to the latest PR. I'll attach a screenshot I took earlier to show you what happens, now it does so at every training in the 5 tutorials I've gone through this afternoon so far... do you know what can I do not to have all these useless prints? This issue started at the beginning of this week, maybe something needs to be fixed in the validation part of the training @dario-coscia @FilippoOlivo |
|
Hi @MatteB03! Please be mindful not to upload raw files, logs, or other large object files to PINA. They take up a lot of space and can be tricky to remove once uploaded. |
Yep, this happened in the tutorials I just mentioned on Slack as I really didn't notice the empty outputs, once solved the big issue of this week I'll make sure to run everything again to delete those space-consuming abominations |
|
Ok now that I removed all hidden outputs and extra files the dimensions of the PR are acceptable, but I did NOT solve the validation problem that I exposed this morning on pina... I simply deleted those outputs, and I don't think it would be useful to put train=1.0 everywhere like @FilippoOlivo told me to do in tutorial 13. I need help solving this problem, I can't figure out what is causing it among the changes of this past week... |
670781f to
69a37a7
Compare
4ea6df6 to
c9880eb
Compare
|
@MatteB03 can I start reviewing? |
I'd say so, aside from that issue with tensorboard everything works. |
--------- Co-authored-by: Dario Coscia <[email protected]>
--------- Co-authored-by: Dario Coscia <[email protected]>
