tft_torch.base_blocks module

Implements some basic utility modeling blocks required for the primary model.

class tft_torch.base_blocks.TimeDistributed(module: torch.nn.modules.module.Module, batch_first: bool = True, return_reshaped: bool = True)

This module can wrap any given module and stacks the time dimension with the batch dimension of the inputs before applying the module. Borrowed from this fruitful discussion thread.

Parameters
  • module (nn.Module) – The wrapped module.

  • batch_first (bool) – A boolean indicating whether the batch dimension is expected to be the first dimension of the input or not.

  • return_reshaped (bool) – A boolean indicating whether to return the output in the corresponding original shape or not.