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/dlinear padding for even kernel size #1695

Merged
merged 4 commits into from
Apr 11, 2023
Merged

Conversation

madtoinou
Copy link
Collaborator

Fixes #1613.

Summary

Dlinear was supporting odd kernel size only. Instead of enforcing this restriction, use asymmetrical padding for even kernel size (one less sample on the front/start/left side of the input TimeSeries). Also updated the docstring for this argument.

Other Information

Added corresponding tests.

@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.11 ⚠️

Comparison is base (622ff06) 94.15% compared to head (840396b) 94.04%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1695      +/-   ##
==========================================
- Coverage   94.15%   94.04%   -0.11%     
==========================================
  Files         125      125              
  Lines       11466    11456      -10     
==========================================
- Hits        10796    10774      -22     
- Misses        670      682      +12     
Impacted Files Coverage Δ
darts/models/forecasting/dlinear.py 100.00% <100.00%> (ø)

... and 10 files with indirect coverage changes

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

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

Looks good, thanks @madtoinou 🚀 Is there any source to explain why this works/is better?

@dennisbader dennisbader merged commit c497a03 into master Apr 11, 2023
@dennisbader dennisbader deleted the fix/dlinear_padding branch April 11, 2023 09:25
alexcolpitts96 pushed a commit to alexcolpitts96/darts that referenced this pull request May 31, 2023
* fix: asymetrical padding when using even kernel size, moved the computation of the padding in the constructor instead of the forward method

* feat: added unitest to cover both even and odd kernel size values

---------

Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
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.

[BUG]issue in Dlinear padding
3 participants