Skip to content

#1103 Fixed small issues with N-BEATS and N-HITS #1130

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

Merged
merged 6 commits into from
Aug 9, 2022

Conversation

rijkvandermeulen
Copy link
Contributor

Fixes an issue where num_stacks is used instead of self.num_stacks in the NBEATSModel. Also addresses a few mistakes in API reference docs.

Summary

  • Corrected mistake in NBEATS model where num_stacks was used iso self.num_stacks
  • In the API reference documentation for both N-BEATS and N-HITS it was stated that num_layers is only used if generic _architecture is set to True. This is not the case, it's used all the times for N-BEATS and I believe N-HITS does not have a generic_architecture parameter. This has now been changed.

Other Information

Fixed an unrelated minor typo somewhere else in the docs

…iso self.num_stacks. Also adjusted the API reference docs
@codecov-commenter
Copy link

codecov-commenter commented Aug 7, 2022

Codecov Report

Merging #1130 (719f91a) into master (7ad25b4) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1130      +/-   ##
==========================================
- Coverage   93.75%   93.75%   -0.01%     
==========================================
  Files          80       80              
  Lines        8157     8144      -13     
==========================================
- Hits         7648     7635      -13     
  Misses        509      509              
Impacted Files Coverage Δ
darts/models/forecasting/nhits.py 98.55% <ø> (-0.02%) ⬇️
darts/models/forecasting/nbeats.py 98.11% <100.00%> (ø)
darts/timeseries.py 92.23% <0.00%> (-0.07%) ⬇️
...arts/models/forecasting/torch_forecasting_model.py 89.54% <0.00%> (-0.05%) ⬇️
darts/models/forecasting/block_rnn_model.py 98.24% <0.00%> (-0.04%) ⬇️
darts/datasets/__init__.py 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@hrzn hrzn linked an issue Aug 8, 2022 that may be closed by this pull request
Copy link
Contributor

@hrzn hrzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, only a couple of small things to fix

CHANGELOG.md Outdated
@@ -34,6 +34,7 @@ Darts is still in an early development phase and we cannot always guarantee back
- An issue with arguments being reverted for the `metric` function of gridsearch and backtest [#989](https://github.com/unit8co/darts/pull/989) by [Clara Grotehans](https://github.com/ClaraGrthns).
- An error checking whether `fit()` has been called in global models [#944](https://github.com/unit8co/darts/pull/944) by [Julien Herzen](https://github.com/hrzn).
- An error in Gaussian Process filter happening with newer versions of sklearn [#963](https://github.com/unit8co/darts/pull/963) by [Julien Herzen](https://github.com/hrzn).
- An issue where num_stacks is used instead of self.num_stacks in the NBEATSModel. Also, a few mistakes in API reference docs [#1103](https://github.com/unit8co/darts/pull/1103) by [Rijk van der Meulen](https://github.com/rijkvandermeulen)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for adding an entry, however you should add it under the Unreleased section (not the already-release 0.20.0 version).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my bad, of course. I've changed it.

@@ -760,7 +759,7 @@ def __init__(
self.num_stacks = 2

if isinstance(layer_widths, int):
self.layer_widths = [layer_widths] * num_stacks
self.layer_widths = [layer_widths] * self.num_stacks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also bring the same fix to nhits.py ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -574,7 +574,6 @@ def __init__(
The number of blocks making up every stack.
num_layers
The number of fully connected layers preceding the final forking layers in each block of every stack.
Only used if `generic_architecture` is set to `True`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also change the docstring of _NBEATSModule ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@hrzn hrzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hrzn hrzn merged commit df4e2d7 into unit8co:master Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix small issues with N-BEATS / NHiTS
3 participants