espnet.nets.pytorch_backend.tacotron2.decoder.Prenet
Less than 1 minute
espnet.nets.pytorch_backend.tacotron2.decoder.Prenet
class espnet.nets.pytorch_backend.tacotron2.decoder.Prenet(idim, n_layers=2, n_units=256, dropout_rate=0.5)
Bases: Module
Prenet module for decoder of Spectrogram prediction network.
This is a module of Prenet in the decoder of Spectrogram prediction network, which described in Natural TTS Synthesis by Conditioning WaveNet on Mel Spectrogram Predictions. The Prenet preforms nonlinear conversion of inputs before input to auto-regressive lstm, which helps to learn diagonal attentions.
NOTE
This module alway applies dropout even in evaluation. See the detail in Natural TTS Synthesis by Conditioning WaveNet on Mel Spectrogram Predictions.
Initialize prenet module.
- Parameters:
- idim (int) – Dimension of the inputs.
- odim (int) – Dimension of the outputs.
- n_layers (int , optional) – The number of prenet layers.
- n_units (int , optional) – The number of prenet units.
forward(x)
Calculate forward propagation.
- Parameters:x (Tensor) – Batch of input tensors (B, …, idim).
- Returns: Batch of output tensors (B, …, odim).
- Return type: Tensor