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
