-
Notifications
You must be signed in to change notification settings - Fork 697
[ENH] Allow direct initialization of NBeats
model without from_dataset
#1837
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
base: main
Are you sure you want to change the base?
[ENH] Allow direct initialization of NBeats
model without from_dataset
#1837
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1837 +/- ##
=======================================
Coverage ? 86.85%
=======================================
Files ? 101
Lines ? 8085
Branches ? 0
=======================================
Hits ? 7022
Misses ? 1063
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Thanks!
Quick question, why are we changing the old test? Does this mean existing code breaks?
We should avoid to break working code of users.
Hi @fkiraly, Passing a list of length 3 was causing the following error:
Let me know if you'd like to handle this differently! |
Can you explain why the |
@MeherBhaskar can I request that we also allow training the model this way: output = model(x) |
I encountered a similar issue in nhits too! Apparently, even if you just have two hidden layers, its asking hidden_size as 3 elements! What happens was that, there is a weird implementation in the NHiTS block for MLP, it adds the input_feature which are features of the input layer to the hidden size! This was forcibly needed to be able to fix the input_feature of the first hidden layer as supplied by the input layer. That is why I have this pull request to avoid this confusion: #1864 Note that, i also saw this same style from the reference code of the paper authors, so it was nobody's fault. NBeaTS might also have this same confusion? Ref: Check out the |
NBeats
model without from_dataset
Description
This PR fixes issue #1548 where the NBeats model fails when initialized without using the
from_dataset
method. The changes enable direct initialization while maintaining backward compatibility and adding proper validation.Changes
__init__
method with comprehensive parameter validationfrom_dataset
method documentation to clarify its roleNow users can:
from_dataset
(recommended) for standard time series forecastingExample of direct initialization:
Checklist
pre-commit install
.To run hooks independent of commit, execute
pre-commit run --all-files
Make sure to have fun coding!