Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
carusyte committed Feb 5, 2025
1 parent 5c1a338 commit 7810e26
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion neuralforecast/common/_base_multivariate.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,18 @@ def _create_windows(self, batch, step):
elif step in ["predict", "val"]:

if step == "predict":
# temp fix for https://github.com/Nixtla/neuralforecast/issues/1056
initial_input = temporal.shape[-1] - self.test_size
if (
initial_input <= self.input_size
): # There is not enough data to predict first timestamp
padder_left = nn.ConstantPad1d(
padding=(self.input_size - initial_input, 0), value=0
)
temporal = padder_left(temporal)
predict_step_size = self.predict_step_size
cutoff = -self.input_size - self.test_size
temporal = batch["temporal"][:, :, cutoff:]
temporal = temporal[:, :, cutoff:]

elif step == "val":
predict_step_size = self.step_size
Expand Down

0 comments on commit 7810e26

Please sign in to comment.