espnet2.gan_svs.vits.duration_predictor.DurationPredictor
Less than 1 minute
espnet2.gan_svs.vits.duration_predictor.DurationPredictor
class espnet2.gan_svs.vits.duration_predictor.DurationPredictor(channels, filter_channels, kernel_size, dropout_rate, global_channels=0)
Bases: Module
Initialize duration predictor module.
- Parameters:
- channels (int) – Number of input channels.
- filter_channels (int) – Number of filter channels.
- kernel_size (int) – Size of the convolutional kernel.
- dropout_rate (float) – Dropout rate.
- global_channels (int , optional) – Number of global conditioning channels.
forward(x, x_mask, g=None)
Forward pass through the duration predictor module.
- Parameters:
- x (Tensor) – Input tensor (B, in_channels, T).
- x_mask (Tensor) – Mask tensor (B, 1, T).
- g (Tensor , optional) – Global condition tensor (B, global_channels, 1).
- Returns: Predicted duration tensor (B, 2, T).
- Return type: Tensor