Unverified Commit 78c382ee authored by hwangjeff's avatar hwangjeff Committed by GitHub
Browse files

Update Tacotron2 docs (#1840)

parent c38ecd2e
...@@ -31,8 +31,8 @@ Tacotron2 ...@@ -31,8 +31,8 @@ Tacotron2
Model Model
----- -----
Tacotoron2 Tacotron2
^^^^^^^^^^ ^^^^^^^^^
.. autoclass:: Tacotron2 .. autoclass:: Tacotron2
......
...@@ -1091,21 +1091,23 @@ class Tacotron2(nn.Module): ...@@ -1091,21 +1091,23 @@ class Tacotron2(nn.Module):
The input ``mel_specgram`` should be padded with zeros to length max of ``mel_specgram_lengths``. The input ``mel_specgram`` should be padded with zeros to length max of ``mel_specgram_lengths``.
Args: Args:
text (Tensor): The input text to Tacotron2 with shape (n_batch, max of ``text_lengths``). text (Tensor): The input text to Tacotron2 with shape `(n_batch, max of text_lengths)`.
text_lengths (Tensor): The length of each text with shape (n_batch). text_lengths (Tensor): The length of each text with shape `(n_batch, )`.
mel_specgram (Tensor): The target mel spectrogram mel_specgram (Tensor): The target mel spectrogram
with shape (n_batch, n_mels, max of ``mel_specgram_lengths``). with shape `(n_batch, n_mels, max of mel_specgram_lengths)`.
mel_specgram_lengths (Tensor): The length of each mel spectrogram with shape (n_batch). mel_specgram_lengths (Tensor): The length of each mel spectrogram with shape `(n_batch, )`.
Returns: Returns:
mel_specgram (Tensor): Mel spectrogram before Postnet Tensor, Tensor, Tensor, and Tensor:
with shape (n_batch, n_mels, max of ``mel_specgram_lengths``). Tensor
mel_specgram_postnet (Tensor): Mel spectrogram after Postnet Mel spectrogram before Postnet with shape `(n_batch, n_mels, max of mel_specgram_lengths)`.
with shape (n_batch, n_mels, max of ``mel_specgram_lengths``). Tensor
stop_token (Tensor): The output for stop token at each time step Mel spectrogram after Postnet with shape `(n_batch, n_mels, max of mel_specgram_lengths)`.
with shape (n_batch, max of ``mel_specgram_lengths``). Tensor
alignment (Tensor): Sequence of attention weights from the decoder. The output for stop token at each time step with shape `(n_batch, max of mel_specgram_lengths)`.
with shape (n_batch, max of ``mel_specgram_lengths``, max of ``text_lengths``). Tensor
Sequence of attention weights from the decoder with
shape `(n_batch, max of mel_specgram_lengths, max of text_lengths)`.
""" """
embedded_inputs = self.embedding(text).transpose(1, 2) embedded_inputs = self.embedding(text).transpose(1, 2)
...@@ -1139,17 +1141,19 @@ class Tacotron2(nn.Module): ...@@ -1139,17 +1141,19 @@ class Tacotron2(nn.Module):
The input `text` should be padded with zeros to length max of ``text_lengths``. The input `text` should be padded with zeros to length max of ``text_lengths``.
Args: Args:
text (Tensor): The input text to Tacotron2 with shape (n_batch, max of ``text_lengths``). text (Tensor): The input text to Tacotron2 with shape `(n_batch, max of text_lengths)`.
text_lengths (Tensor or None, optional): The length of each text with shape `(n_batch, )`. text_lengths (Tensor or None, optional): The length of each text with shape `(n_batch, )`.
If ``None``, it is assumed that the all the texts are valid. Default: ``None`` If ``None``, it is assumed that the all the texts are valid. Default: ``None``
Return: Returns:
mel_specgram (Tensor): The predicted mel spectrogram Tensor, Tensor, and Tensor:
with shape (n_batch, n_mels, max of ``mel_specgram_lengths.max()``). Tensor
mel_specgram_lengths (Tensor): The length of the predicted mel spectrogram The predicted mel spectrogram with shape `(n_batch, n_mels, max of mel_specgram_lengths)`.
with shape (n_batch, ). Tensor
alignments (Tensor): Sequence of attention weights from the decoder. The length of the predicted mel spectrogram with shape `(n_batch, )`.
with shape (n_batch, max of ``mel_specgram_lengths``, max of ``text_lengths``). Tensor
Sequence of attention weights from the decoder with shape
`(n_batch, max of mel_specgram_lengths, max of text_lengths)`.
""" """
n_batch, max_length = text.shape n_batch, max_length = text.shape
if text_lengths is None: if text_lengths is None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment