Skip to content

Commit 66430cb

Browse files
authored
fix nlinear norm (#2724)
* fix nlinear norm * update changelog
1 parent 07fe105 commit 66430cb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ but cannot always guarantee backwards compatibility. Changes that may **break co
2929
**Fixed**
3030

3131
- 🔴 / 🟢 Fixed a bug which raised an error when loading torch models that were saved with Darts versions < 0.33.0. This is a breaking change and models saved with version 0.33.0 will not be loadable anymore. [#2692](https://github.com/unit8co/darts/pull/2692) by [Dennis Bader](https://github.com/dennisbader).
32+
- Fixed a bug in `NLinearModel` with `normalize=True` where the normalization was not applied properly. The predictive power is now greatly improved. [#2699](https://github.com/unit8co/darts/pull/2699) by [Dennis Bader](https://github.com/dennisbader).
3233
- Fixed a bug in `StaticCovariatesTransformer` which raised an error when trying to inverse transform one-hot encoded categorical static covariates with identical values across time-series. Each categorical static covariates is now referred to by `{covariate_name}_{category_name}`, regardless of the number of categories. [#2710](https://github.com/unit8co/darts/pull/2710) by [Antoine Madrona](https://github.com/madtoinou)
3334
- Fixed a bug in `13-TFT-examples.ipynb` where two calls to `TimeSeries.from_series()` were not providing `series` but `pd.Index`. The method calls were changed to `TimeSeries.from_values()`. [#2719](https://github.com/unit8co/darts/pull/2719) by [Jules Authier](https://github.com/authierj)
3435
- Fixed a bug in `RegressionModel` where performing optimized historical forecasts with `max(lags) < -1` resulted in forecasts that extended too far into the future. [#2715](https://github.com/unit8co/darts/pull/2715) by [Jules Authier](https://github.com/authierj)

darts/models/forecasting/nlinear.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def forward(
141141
else:
142142
if self.normalize:
143143
# get last values only for target features
144-
seq_last = x[:, -1:, : self.output_dim].detach()
144+
seq_last = x[:, -1:, : self.output_dim].detach().clone()
145145
# normalize the target features only (ignore the covariates)
146146
x[:, :, : self.output_dim] = x[:, :, : self.output_dim] - seq_last
147147

0 commit comments

Comments
 (0)