espnet2.gan_codec.shared.decoder.seanet_2d.SEANetResnetBlock2d
espnet2.gan_codec.shared.decoder.seanet_2d.SEANetResnetBlock2d
class espnet2.gan_codec.shared.decoder.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.
- Parameters:
- dim (int) – Dimension of the input/output
- kernel_sizes (list) – List of kernel sizes for the convolutions.
- dilations (list) – List of dilations for the convolutions.
- activation (str) – Activation function.
- activation_params (dict) – Parameters to provide to the activation function
- norm (str) – Normalization method.
- norm_params (dict) – Parameters to provide to the underlying normalization used along with the convolution.
- 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.