espnet2.gan_codec.shared.encoder.seanet_2d.SEANetResnetBlock2d
espnet2.gan_codec.shared.encoder.seanet_2d.SEANetResnetBlock2d
class espnet2.gan_codec.shared.encoder.seanet_2d.SEANetResnetBlock2d(dim: int, kernel_sizes: List[Tuple[int, int]] = [(3, 3), (1, 1)], dilations: List[Tuple[int, int]] = [(1, 1), (1, 1)], activation: str = 'ELU', activation_params: dict = {'alpha': 1.0}, norm: str = 'weight_norm', norm_params: Dict[str, Any] = {}, causal: bool = False, pad_mode: str = 'reflect', compress: int = 2, true_skip: bool = True, conv_group_ratio: int = -1)
Bases: Module
Residual block from SEANet model. :param dim: Dimension of the input/output :type dim: int :param kernel_sizes: List of kernel sizes for the convolutions. :type kernel_sizes: list :param dilations: List of dilations for the convolutions. :type dilations: list :param activation: Activation function. :type activation: str :param activation_params: Parameters to provide to the activation function :type activation_params: dict :param norm: Normalization method. :type norm: str :param norm_params: Parameters to provide to the underlying normalization
used along with the convolution.
- Parameters:
- causal (bool) – Whether to use fully causal convolution.
- pad_mode (str) – Padding mode for the convolutions.
- compress (int) – Reduced dimensionality in residual branches (from Demucs v3)
- true_skip (bool) – Whether to use true skip connection or a simple convolution as the skip connection.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(x)
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.