Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update gradient_clip=0.01 to gradient_clip=0.1.
Description
I've been following along with the Interpretable forecasting with N-Beats tutorial found here https://pytorch-forecasting.readthedocs.io/en/latest/tutorials/ar.html, copy-pasting the code exactly, and I am getting different results compared to what is shown on the documentation page.
The first discrepancy between my results and the tutorial is when using lightning.pytorch.tuner.Tuner to find the optimal learning rate. The suggested learning rate and resulting plot are different.
Perhaps more of a problem, however, is that my model fails to learn (training loss doesn't decrease), even when increasing the epochs. When I run the code from the Evaluate Results section, all of the resulting plots show a flat predicted curve.
I believe I've found the problem. Testing on my side confirms.
Code cells [6] and [14] have the parameter gradient_clip=0.01, which is the source of the problem. The N-HiTS tutorial uses gradient_clip=0.1, so I tried that out, which fixes the problem. The outputs don't match the tutorial outputs exactly, but they're much closer than what gradient_clip=0.01 yields.
Checklist
pre-commit install
.To run hooks independent of commit, execute
pre-commit run --all-files
Make sure to have fun coding!