espnet.nets.pytorch_backend.transducer.conv1d_nets.CausalConv1d
Less than 1 minute
espnet.nets.pytorch_backend.transducer.conv1d_nets.CausalConv1d
class espnet.nets.pytorch_backend.transducer.conv1d_nets.CausalConv1d(idim: int, odim: int, kernel_size: int, stride: int = 1, dilation: int = 1, groups: int = 1, bias: bool = True, batch_norm: bool = False, relu: bool = True, dropout_rate: float = 0.0)
Bases: Module
1D causal convolution module for custom decoder.
- Parameters:
- idim – Input dimension.
- odim – Output dimension.
- kernel_size – Size of the convolving kernel.
- stride – Stride of the convolution.
- dilation – Spacing between the kernel points.
- groups – Number of blocked connections from input channels to output channels.
- bias – Whether to add a learnable bias to the output.
- batch_norm – Whether to apply batch normalization.
- relu – Whether to pass final output through ReLU activation.
- dropout_rate – Dropout rate.
Construct a CausalConv1d object.
forward(sequence: Tensor, mask: Tensor, cache: Tensor | None = None) → Tuple[Tensor, Tensor]
Forward CausalConv1d for custom decoder.
- Parameters:
- sequence – CausalConv1d input sequences. (B, U, D_in)
- mask – Mask of CausalConv1d input sequences. (B, 1, U)
- Returns: CausalConv1d output sequences. (B, sub(U), D_out) mask: Mask of CausalConv1d output sequences. (B, 1, sub(U))
- Return type: sequence