[DOC] Add DecoderMLP usage example - #2379
Open
ZhangStudyLife wants to merge 1 commit into
Open
Conversation
ZhangStudyLife
requested review from
benHeid,
fkiraly,
jdb78 and
phoeenniixx
as code owners
August 9, 2026 13:39
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2379 +/- ##
=======================================
Coverage ? 87.45%
=======================================
Files ? 175
Lines ? 10165
Branches ? 0
=======================================
Hits ? 8890
Misses ? 1275
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
phoeenniixx
reviewed
Aug 10, 2026
| >>> from lightning.pytorch import Trainer | ||
| >>> from pytorch_forecasting import DecoderMLP, TimeSeriesDataSet | ||
| >>> _ = torch.manual_seed(0) | ||
| >>> data = pd.DataFrame( |
phoeenniixx
reviewed
Aug 10, 2026
| >>> import torch | ||
| >>> from lightning.pytorch import Trainer | ||
| >>> from pytorch_forecasting import DecoderMLP, TimeSeriesDataSet | ||
| >>> _ = torch.manual_seed(0) |
Member
There was a problem hiding this comment.
is there a specific reason for setting a seed here? I mean it is just an example, it doesnt need to be reproducible :)
phoeenniixx
requested changes
Aug 10, 2026
phoeenniixx
left a comment
Member
There was a problem hiding this comment.
Thanks a lot and welcome to pytorch-forecasting! I think this is ready to merge, just a few doubts (see above)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reference Issues/PRs
Partially addresses #2377.
This is intentionally limited to the v1
DecoderMLPmodel. #2378 covers DeepAR and NBeats.What does this implement/fix?
This PR adds a focused, runnable usage example to the v1
DecoderMLPdocstring. The example demonstrates:TimeSeriesDataSetconstruction;DecoderMLP.from_dataset();fast_dev_run=True;It also adds a minimal package-container linkage example, following the documentation structure used for the other v1 models.
The example does not download external data, require a GPU, or change model behavior.
What should a reviewer concentrate their feedback on?
Did you add any tests for the change?
The examples are executable doctests. Local validation completed on Windows, Python 3.12, and CPU:
tests/test_models/test_mlp.py: 7 passed;Any other comments?
The change is limited to two DecoderMLP documentation files. No model weights, datasets, generated files, or unrelated formatting changes are included.
Thank you for taking the time to review this contribution.
PR checklist