gluonts.mx.block.cnn module#
- class gluonts.mx.block.cnn.CausalConv1D(channels: int, kernel_size: Union[int, Tuple[int], List[int]], dilation: Union[int, Tuple[int], List[int]] = 1, activation: Optional[str] = None, **kwargs)[source]#
Bases:
HybridBlock
1D causal temporal convolution, where the term causal means that output[t] does not depend on input[t+1:]. Notice that Conv1D is not implemented in Gluon.
This is the basic structure used in Wavenet [ODZ+16] and Temporal Convolution Network [BKK18].
The output has the same shape as the input, while we always left-pad zeros.
- Parameters
channels – The dimensionality of the output space, i.e. the number of output channels (filters) in the convolution.
kernel_size – Specifies the dimensions of the convolution window.
dilation – Specifies the dilation rate to use for dilated convolution.
activation – Activation function to use. See
Activation()
. If you don’t specify anything, no activation is applied (ie. “linear” activation: a(x) = x).
- hybrid_forward(F, data: Union[NDArray, Symbol]) Union[NDArray, Symbol] [source]#
In Gluon’s conv1D implementation, input has dimension NCW where N is batch_size, C is channel, and W is time (sequence_length).
- Parameters
data – Shape (batch_size, num_features, sequence_length)
- Returns
causal conv1d output. Shape (batch_size, num_features, sequence_length)
- Return type
Tensor
- class gluonts.mx.block.cnn.DilatedCausalGated(inner_channels: int, out_channels: int, kernel_size: Union[int, Tuple[int], List[int]], dilation: Union[int, Tuple[int], List[int]], **kwargs)[source]#
Bases:
HybridBlock
1D convolution with Gated mechanism, see the Wavenet papers described above.
- Parameters
inner_channels – The dimensionality of the intermediate space
out_channels – The dimensionality of the output space
kernel_size – Specifies the dimensions of the convolution window.
dilation – Specifies the dilation rate to use for dilated convolution.