espnet2.gan_tts.melgan.residual_stack.ResidualStack
Less than 1 minute
espnet2.gan_tts.melgan.residual_stack.ResidualStack
class espnet2.gan_tts.melgan.residual_stack.ResidualStack(kernel_size: int = 3, channels: int = 32, dilation: int = 1, bias: bool = True, nonlinear_activation: str = 'LeakyReLU', nonlinear_activation_params: Dict[str, Any] = {'negative_slope': 0.2}, pad: str = 'ReflectionPad1d', pad_params: Dict[str, Any] = {})
Bases: Module
Residual stack module introduced in MelGAN.
Initialize ResidualStack module.
- Parameters:
- kernel_size (int) – Kernel size of dilation convolution layer.
- channels (int) – Number of channels of convolution layers.
- dilation (int) – Dilation factor.
- bias (bool) – Whether to add bias parameter in convolution layers.
- nonlinear_activation (str) – Activation function module name.
- nonlinear_activation_params (Dict *[*str , Any ]) – Hyperparameters for activation function.
- pad (str) – Padding function module name before dilated convolution layer.
- pad_params (Dict *[*str , Any ]) – Hyperparameters for padding function.
forward(c: Tensor) → Tensor
Calculate forward propagation.
- Parameters:c (Tensor) – Input tensor (B, channels, T).
- Returns: Output tensor (B, chennels, T).
- Return type: Tensor