Currently, in EncoderDecoderDataModule, y is not normalized if we are using EncoderNormalizer as it is fitted per sequence (during __getitem__). In this case we only normalize target_past and forgot to normalize the decoder indices of the target.
See here, we just normalize target_past and not the decoder indices (or y):
|
if normalizer is not None and normalizer.fit_per_sequence: |
|
target_past = ( |
|
self.data_module._target_normalizer.fit_transform_sequence( |
|
target_past |
|
) |
|
) |
y remains raw:
|
|
|
y = data["target"][decoder_indices] |
|
|
|
if y.shape[-1] > 1: |
|
y = [y[:, i] for i in range(y.shape[-1])] |
|
else: |
|
y = y.squeeze(-1) |
|
return x, y |
Solution
We should normalize y as well
Currently, in
EncoderDecoderDataModule,yis not normalized if we are usingEncoderNormalizeras it is fitted per sequence (during__getitem__). In this case we only normalizetarget_pastand forgot to normalize the decoder indices of the target.See here, we just normalize
target_pastand not the decoder indices (ory):pytorch-forecasting/pytorch_forecasting/data/data_module/_encoder_decoder_data_module.py
Lines 653 to 658 in e7c7965
yremains raw:pytorch-forecasting/pytorch_forecasting/data/data_module/_encoder_decoder_data_module.py
Lines 797 to 804 in e7c7965
Solution
We should normalize
yas well