Closed chenjw505 closed 3 years ago
Hi, In the 'nbeats.py', the class NBeats:
class NBeats(t.nn.Module): def __init__(self, blocks: t.nn.ModuleList): super().__init__() self.blocks = blocks def forward(self, x: t.Tensor, input_mask: t.Tensor) -> t.Tensor: residuals = x.flip(dims=(1,)) input_mask = input_mask.flip(dims=(1,)) forecast = x[:, -1:] for i, block in enumerate(self.blocks): backcast, block_forecast = block(residuals) residuals = (residuals - backcast) * input_mask forecast = forecast + block_forecast return forecast
in the forward funtion, why do this operation: ‘residuals = x.flip(dims=(1,))’ ???
Hello, The inverse time axis was used for seasonality model formulation convenience. And it should not have any effect on generic model.
thank u
Hi, In the 'nbeats.py', the class NBeats:
in the forward funtion, why do this operation: ‘residuals = x.flip(dims=(1,))’ ???