espnet2.gan_tts.wavenet.residual_block.ResidualBlock
Less than 1 minute
espnet2.gan_tts.wavenet.residual_block.ResidualBlock
class espnet2.gan_tts.wavenet.residual_block.ResidualBlock(kernel_size: int = 3, residual_channels: int = 64, gate_channels: int = 128, skip_channels: int = 64, aux_channels: int = 80, global_channels: int = -1, dropout_rate: float = 0.0, dilation: int = 1, bias: bool = True, scale_residual: bool = False)
Bases: Module
Residual block module in WaveNet.
Initialize ResidualBlock module.
- Parameters:
- kernel_size (int) β Kernel size of dilation convolution layer.
- residual_channels (int) β Number of channels for residual connection.
- skip_channels (int) β Number of channels for skip connection.
- aux_channels (int) β Number of local conditioning channels.
- dropout (float) β Dropout probability.
- dilation (int) β Dilation factor.
- bias (bool) β Whether to add bias parameter in convolution layers.
- scale_residual (bool) β Whether to scale the residual outputs.
forward(x: Tensor, x_mask: Tensor | None = None, c: Tensor | None = None, g: Tensor | None = None) β Tuple[Tensor, Tensor]
Calculate forward propagation.
- Parameters:
- x (Tensor) β Input tensor (B, residual_channels, T).
- Optional**[torch.Tensor]** (x_mask) β Mask tensor (B, 1, T).
- c (Optional *[*Tensor ]) β Local conditioning tensor (B, aux_channels, T).
- g (Optional *[*Tensor ]) β Global conditioning tensor (B, global_channels, 1).
- Returns: Output tensor for residual connection (B, residual_channels, T). Tensor: Output tensor for skip connection (B, skip_channels, T).
- Return type: Tensor
