-
Notifications
You must be signed in to change notification settings - Fork 923
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
[BUG] Several issues with NLinear with normalize=True
#2699
Comments
Hi @turbotimon and thanks a lot for raising this issue 👍 Regarding why normalization was disabled by default (from #1292 by @hrzn).
However, since it raises an error when using a Likelihood (probabilistic model), it probably should have been I think we can set So let's do this:
Regarding normalization of covariates. I'm a bit hesitant to just apply it to all covariates. We had a discussion already about it in the last changes to the model #1873. :) I add it to our backlog. Would you be interested in contributing to this fix? |
Agree. In addition, I think a
Sounds reasonable
I see your point for the special case of future covariates like datetime attributes. However, I strongly agree with this statements from felixdivo:
For example, I currently have the case of covariates that show similar cyclic patterns as the target, but very different trend levels over time. This is way I came up with this Idea of a "per sample normalization", just to find out that something like this already exists (as always :) ). However, I can not use the current (even fixed) implementation for my purpose. In my opinion, the darts implementation should be as close as possible to the original paper, only extending it where possible or fixing major flaws. At least that's what I would expect as a user of the library. I see the following solutions:
Let me know what you guys think of it.
I would like to do so (as I need it to fix anyway for me personal to use) |
True :) But I'd avoid having a warning raised everytime someone creates an
I'm totally with you that applying it to covariates as well should be possible. The reason I'm reluctant is that I'd want to find a unified solution for this accross all models / normalizations (also Allowing component-wise selection would be the ultimate goal, as in many use cases datetime encodings are used together with other covariates. :)
That's true but we also add additional features to models that didn't exist in the source paper to improve model performance (see RINorm for example, probabilistic support for all models, ...). So if we can find a neat way to generalize this logic, I'm all in.
Thanks, that's great to hear :) 🚀 |
@dennisbader I found another discussible thing in the implementation: With P.S. Still looking forward to making a merge request (also because the |
@dennisbader I finally found time to fix the nlinear #2757. Details on the fixes in the PR summary. Some important remarks for the tests in
|
Describe the bug
After reading the paper and having a closer look at the implementation of
DLinearModel
, I see several issues:The
seq_last
is only detached, but needs to be cloned as well. Otherwise, it it's values will be changed by linedarts/darts/models/forecasting/nlinear.py
Line 146 in 8bea071
seq_last = x[:, -1:, : self.output_dim].detach().clone()
Why is the normalization disabled by default? That's the whole catch of this model, so it should be enabled by default. (I could only imagine that it performed so bad due to the bug, that it was disabled by default)
The normalization is only done for the target and not covariates (
darts/darts/models/forecasting/nlinear.py
Line 145 in 8bea071
To Reproduce
With normalize=True, NLinear currently fails to solve even very simple tasks:
Expected behavior
Output around ~10.0
System (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: