LengthRegulator
Helpers & Utilities · AiDotNet.TextToSpeech
FastSpeech’s length regulator (Ren et al. 2019, §3.2): repeats each token’s hidden state for its duration in frames, so a token-level sequence becomes frame-level.
How It Works
The repetition is an index-select on the gradient tape, so gradients flow back to every token.
Methods
| Method | Summary |
|---|---|
Tensor<T> Expand(Tensor<T> tokens, int[] durations) |
Repeats row i of tokens ([tokens, hidden], or [1, tokens, hidden]) durations[i] times, giving [frames, hidden] (or [1, frames, hidden]). |