Skip to content
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

Fix wrong seasonality basis generator for NBEATS #804

Merged
merged 2 commits into from
Feb 17, 2022
Merged

Fix wrong seasonality basis generator for NBEATS #804

merged 2 commits into from
Feb 17, 2022

Conversation

vladimir-chernykh
Copy link
Contributor

Fixes #803.

Summary

It fixes wrong seasonality basis vectors generated for NBEATS interpretable model. Now the basis vectors are normalized by the horizon length as it is done in the paper.

Other Information

--

Copy link
Collaborator

@dennisbader dennisbader left a comment

Choose a reason for hiding this comment

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

Hi @vladimir-chernykh and thanks a lot for pointing this out!

I checked and agree with you. That one was easy to overlook!

I initiated the tests

@codecov-commenter
Copy link

Codecov Report

Merging #804 (a025c51) into master (73a1645) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #804   +/-   ##
=======================================
  Coverage   91.04%   91.04%           
=======================================
  Files          69       69           
  Lines        6858     6858           
=======================================
  Hits         6244     6244           
  Misses        614      614           
Impacted Files Coverage Δ
darts/models/forecasting/nbeats.py 99.27% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73a1645...a025c51. Read the comment docs.

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!

@vladimir-chernykh
Copy link
Contributor Author

@hrzn,

I believe the range of i should start from 0 for both sines and cosines.

Screenshot 2022-02-17 at 12 32 22

What you're talking about I think is the theta coefficients. For cosines we take first floor(H/2-1) values from theta vector and for sines we take next floor(H/2-1) values starting from floor(H/2). But this is already done correctly in the DARTS. So in my opinion no more changes needed here.

@hrzn
Copy link
Contributor

hrzn commented Feb 17, 2022

@hrzn,

I believe the range of i should start from 0 for both sines and cosines.

Screenshot 2022-02-17 at 12 32 22

What you're talking about I think is the theta coefficients. For cosines we take first floor(H/2-1) values from theta vector and for sines we take next floor(H/2-1) values starting from floor(H/2). But this is already done correctly in the DARTS. So in my opinion no more changes needed here.

You are right - I convinced myself too between my earlier comment and now. Thanks for checking - and good catch! We will release it (along with a planned patch release) asap.

@hrzn hrzn merged commit 6da5957 into unit8co:master Feb 17, 2022
@vladimir-chernykh vladimir-chernykh deleted the fix/wrong-nbeats-seasonality-basis branch February 17, 2022 09:48
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.

4 participants