VitsModelOptions
Options & Configuration · AiDotNet.TextToSpeech.EndToEnd
Options shared by the VITS family (VITS, VITS2 and the models built on them): the text encoder, the posterior encoder, the flow, the HiFi-GAN decoder and discriminators, the training objective and the optimizer.
Inheritance: ModelOptions → TtsModelOptions → EndToEndTtsOptions → VitsModelOptions
Known derived types: VITS2Options, VITSOptions
For Beginners
These options configure a VITS-style model. Default values follow the original paper settings.
How It Works
Defaults are VITS’s (Kim et al. 2021, §3–4, App. B) with the values it leaves to its reference implementation
(jaywalnut310/vits configs/ljs_base.json, models.py): text encoder width 192, 6 relative-position layers,
2 heads, window 4, filter 768, kernel 3, dropout 0.1; latent 192; posterior encoder of 16 WaveNet layers (kernel 5);
flow of 4 residual couplings with 4 WaveNet layers (kernel 5); HiFi-GAN V1 decoder (512 channels, rates 8, 8, 2, 2,
kernels 16, 16, 4, 4, resblocks 3, 7, 11 with dilations 1, 3, 5); periods 2, 3, 5, 7, 11 plus one scale
discriminator; 8192-sample decoder segments; λ_mel = 45, λ_kl = 1; AdamW (β = 0.8, 0.99, ε = 1e-9, weight decay 0.01)
at 2e-4 decayed 0.999875 per epoch; 22.05 kHz, 1024-point FFT, hop 256, 80 mel bins; prior noise scale 0.667 at
synthesis; a 256-wide speaker table when there are several speakers.
Properties
| Property | Summary |
|---|---|
bool AddBlank { get; set; } |
Gets or sets whether a blank token (0) is placed between and around the characters. |
double Beta1 { get; set; } |
Gets or sets AdamW’s β₁ (0.8). |
double Beta2 { get; set; } |
Gets or sets AdamW’s β₂ (0.99). |
double DurationPredictorDropout { get; set; } |
Gets or sets the duration predictor’s dropout (0.5). |
double Epsilon { get; set; } |
Gets or sets AdamW’s ε (1e-9). |
double KlLossWeight { get; set; } |
Gets or sets λ_kl (1). |
double LearningRateDecay { get; set; } |
Gets or sets the per-epoch learning-rate decay (0.999875). |
double LengthScale { get; set; } |
Gets or sets the duration multiplier at synthesis (1). |
double MelLossWeight { get; set; } |
Gets or sets λ_mel (45). |
double NoiseScale { get; set; } |
Gets or sets the prior noise scale at synthesis (0.667). |
int DiscriminatorWidthDivisor { get; set; } |
Gets or sets a divisor on every discriminator width (1: the paper’s widths). |
int DurationPredictorKernelSize { get; set; } |
Gets or sets the duration predictor’s kernel (3). |
int EncoderKernelSize { get; set; } |
Gets or sets the text encoder’s feed-forward kernel (3). |
int FlowKernelSize { get; set; } |
Gets or sets the flow couplings’ WaveNet kernel (5). |
int FlowLayers { get; set; } |
Gets or sets the WaveNet layers in each flow coupling (4). |
int LanguageEmbeddingDim { get; set; } |
Gets or sets the width of the language embedding (4, YourTTS §2). |
int NumDecoderLayers { get; set; } |
The number of HiFi-GAN upsampling stages in the native waveform decoder. |
int NumLanguages { get; set; } |
Gets or sets the number of languages; above one, a language embedding is concatenated to every character embedding and conditions the duration predictor, and every training sample and synthesis names its language (YourTTS §2; 0: a monolingu… |
int NumSpeakers { get; set; } |
Gets or sets the number of speakers; above one, a speaker table conditions the model and every training sample and synthesis names its speaker (0: a single-speaker model). |
int PosteriorKernelSize { get; set; } |
Gets or sets the posterior encoder’s WaveNet kernel (5). |
int PosteriorLayers { get; set; } |
Gets or sets the posterior encoder’s WaveNet layers (16). |
int RelativeWindow { get; set; } |
Gets or sets the text encoder attention’s maximum relative position (4). |
int ResblockType { get; set; } |
Gets or sets the decoder’s residual block type (1: HiFi-GAN V1’s three-layer blocks; 2: the one-convolution-per-dilation blocks of HiFi-GAN V2/V3). |
int SamplingSeed { get; set; } |
Gets or sets the seed of the training draws and the synthesis noise, for repeatable runs. |
int SegmentSize { get; set; } |
Gets or sets the decoder’s training segment in samples (8192). |
int SpeakerEmbeddingDim { get; set; } |
Gets or sets the width of the speaker embedding (256, the reference’s gin_channels for VCTK). |
int UpdatesPerEpoch { get; set; } |
Gets or sets the updates in one epoch (196: LJSpeech’s 12,500 training clips at a batch of 64). |
int UpsampleChannelDivisor { get; } |
The factor the upsampling stages halve UpsampleInitialChannels by (2 per stage), which it must therefore be a multiple of for the last stage to keep a channel. |
int UpsampleInitialChannels { get; set; } |
Gets or sets the decoder’s first width (512). |
int WindowSize { get; set; } |
Gets or sets the STFT window (1024). |
int[] DiscriminatorPeriods { get; set; } |
Gets or sets the period discriminators’ periods (2, 3, 5, 7, 11). |
int[] ResblockKernelSizes { get; set; } |
Gets or sets the decoder’s residual block kernels (3, 7, 11). |
int[] UpsampleKernelSizes { get; set; } |
Gets or sets the decoder’s upsampling kernels (16, 16, 4, 4). |
int[] UpsampleRates { get; set; } |
Gets or sets the decoder’s upsampling rates (8, 8, 2, 2; their product is the hop). |
int[][] ResblockDilationSizes { get; set; } |
Gets or sets the decoder’s residual block dilations ((1, 3, 5) for each kernel). |