gluonts.nursery.spliced_binned_pareto.tcn module

class gluonts.nursery.spliced_binned_pareto.tcn.Chomp1d(chomp_size: int, last: bool = True)[source]

Bases: torch.nn.modules.module.Module

Removes leading or trailing elements of a time series.

Takes as input a three-dimensional tensor (B, C, L) where B is the batch size, C is the number of input channels, and L is the length of the input. Outputs a three-dimensional tensor (B, C, L - s) where s is the number of elements to remove.

Parameters
  • chomp_size – Number of elements to remove.

  • last – If True, removes the last elements in the time dimension, If False, removes the fist elements.

forward(x)[source]

Defines 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.

training = None
class gluonts.nursery.spliced_binned_pareto.tcn.TCN(in_channels: int, out_channels: int, kernel_size: int, channels: int, layers: int, bias: bool = True, fwd_time: bool = True)[source]

Bases: torch.nn.modules.module.Module

Temporal Convolutional Network.

Composed of a sequence of causal convolution blocks.

Takes as input a three-dimensional tensor (B, C, L) where B is the batch size, C is the number of input channels, and L is the length of the input. Outputs a three-dimensional tensor (B, C_out, L).

Parameters
  • in_channels – Number of input channels.

  • out_channels – Number of output channels.

  • kernel_size – Kernel size of the applied non-residual convolutions.

  • channels – Number of channels processed in the network and of output channels.

  • layers – Depth of the network.

  • bias – If True, adds a learnable bias to the convolutions.

  • fwd_time – If True the network is the relation relation if from past to future (forward), if False, the relation from future to past (backward).

forward(x)[source]

Defines 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.

training = None
class gluonts.nursery.spliced_binned_pareto.tcn.TCNBlock(in_channels: int, out_channels: int, kernel_size: int, dilation: int, bias: bool = True, fwd_time: bool = True, final: bool = False)[source]

Bases: torch.nn.modules.module.Module

Temporal Convolutional Network block.

Composed sequentially of two causal convolutions (with leaky ReLU activation functions), and a parallel residual connection.

Takes as input a three-dimensional tensor (B, C, L) where B is the batch size, C is the number of input channels, and L is the length of the input. Outputs a three-dimensional tensor (B, C, L).

Parameters
  • in_channels – Number of input channels.

  • out_channels – Number of output channels.

  • kernel_size – Kernel size of the applied non-residual convolutions.

  • dilation – Dilation parameter of non-residual convolutions.

  • bias – If True, adds a learnable bias to the convolutions.

  • fwd_time – If True, the network “causal” direction is from past to future (forward), if False, the relation is from future to past (backward).

  • final – If True, the last activation function is disabled.

forward(x)[source]

Defines 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.

training = None