D and N Linear

class flood_forecast.basic.d_n_linear.NLinear(forecast_history: int, forecast_length: int, enc_in=128, individual=False, n_targs=1)[source]

Normalization-Linear.

__init__(forecast_history: int, forecast_length: int, enc_in=128, individual=False, n_targs=1)[source]

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x: Tensor) Tensor[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class flood_forecast.basic.d_n_linear.MovingAvg(kernel_size, stride)[source]

Moving average block to highlight the trend of time series.

__init__(kernel_size, stride)[source]

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x: Tensor)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class flood_forecast.basic.d_n_linear.SeriesDecomp(kernel_size)[source]

Series decomposition block.

__init__(kernel_size)[source]

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class flood_forecast.basic.d_n_linear.DLinear(forecast_history: int, forecast_length: int, individual, enc_in: int, n_targs=1)[source]

Decomposition-Linear.

__init__(forecast_history: int, forecast_length: int, individual, enc_in: int, n_targs=1)[source]

Code from.

Parameters:
  • forecast_history (int) – _description_

  • forecast_length (int) – _description_

  • individual (_type_) – _description_

  • enc_in (int) – _description_

forward(x: Tensor)[source]

The.

Parameters:

x (_type_) – PyTorch tensor of size [Batch, Input length, Channel]

Returns:

_description_

Return type:

_type_