Variance Predictor
VariancePredictor
Bases: Module
Duration and Pitch predictor neural network module in PyTorch.
It consists of multiple layers, including ConvTransposed layers (custom convolution transpose layers from
the model.conv_blocks module), LeakyReLU activation functions, Layer Normalization and Dropout layers.
Constructor for VariancePredictor class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channels_in |
int
|
Number of input channels. |
required |
channels |
int
|
Number of output channels for ConvTransposed layers and input channels for linear layer. |
required |
channels_out |
int
|
Number of output channels for linear layer. |
required |
kernel_size |
int
|
Size of the kernel for ConvTransposed layers. |
required |
p_dropout |
float
|
Probability of dropout. |
required |
Returns:
| Type | Description |
|---|---|
|
torch.Tensor: Output tensor. |
Source code in models/tts/delightful_tts/acoustic_model/variance_predictor.py
forward(x, mask)
Forward pass for VariancePredictor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x |
Tensor
|
Input tensor. |
required |
mask |
Tensor
|
Mask tensor, has the same size as x. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
torch.Tensor: Output tensor. |