espnet.nets.pytorch_backend.fastspeech.duration_calculator.DurationCalculator
Less than 1 minute
espnet.nets.pytorch_backend.fastspeech.duration_calculator.DurationCalculator
class espnet.nets.pytorch_backend.fastspeech.duration_calculator.DurationCalculator(teacher_model)
Bases: Module
Duration calculator module for FastSpeech.
Initialize duration calculator module.
- Parameters:teacher_model (e2e_tts_transformer.Transformer) – Pretrained auto-regressive Transformer.
forward(xs, ilens, ys, olens, spembs=None)
Calculate forward propagation.
- Parameters:
- xs (Tensor) – Batch of the padded sequences of character ids (B, Tmax).
- ilens (Tensor) – Batch of lengths of each input sequence (B,).
- ys (Tensor) – Batch of the padded sequence of target features (B, Lmax, odim).
- olens (Tensor) – Batch of lengths of each output sequence (B,).
- spembs (Tensor , optional) – Batch of speaker embedding vectors (B, spk_embed_dim).
- Returns: Batch of durations (B, Tmax).
- Return type: Tensor