UnivNetOptions
Options & Configuration · AiDotNet.TextToSpeech.Vocoders
Options for UnivNet (Jang et al. 2021): a GAN vocoder with location-variable convolutions, trained with multi-resolution spectrogram and multi-period discriminators and the multi-resolution STFT loss.
Inheritance: ModelOptions → TtsModelOptions → VocoderOptions → UnivNetOptions
For Beginners
These options configure the UnivNet model. Default values follow the original paper settings.
How It Works
Defaults are the paper’s UnivNet-c32 (§4.1, §4.3): 24 kHz audio with full-band (0–12 kHz) 100-band log-mel input from a 1024-point FFT with hop 256; 64 noise channels; c_G = 32; LVC stacks upsampling 8, 8, 4 with dilations 1, 3, 9, 27; leaky ReLU 0.2; STFT resolutions (1024, 120, 600), (2048, 240, 1200), (512, 50, 240) for the resolution discriminators and the auxiliary loss; λ = 2.5; 200k generator-only steps; Adam (β = 0.5, 0.9) at 1e-4.
What the paper leaves open follows maum-ai/univnet (config/default_c32.yaml): the kernel predictor’s 64
hidden channels and 3-wide convolutions; period discriminators of 64, 128, 256, 512, 1024 channels; 32-channel
resolution discriminators; 16,384-sample segments, batch 32; adversarial terms averaged over the discriminators;
at synthesis ten frames of log(1e-5) appended and their samples trimmed.
Constructors
| Constructor | Summary |
|---|---|
UnivNetOptions() |
Creates the paper’s UnivNet-c32 configuration. |
UnivNetOptions(UnivNetOptions other) |
Initializes a new instance by copying from another instance. |
Properties
| Property | Summary |
|---|---|
double Beta1 { get; set; } |
Gets or sets Adam’s β₁ (0.5). |
double Beta2 { get; set; } |
Gets or sets Adam’s β₂ (0.9). |
double LeakyReluSlope { get; set; } |
Gets or sets the leaky ReLU slope (0.2). |
double MelMaxFrequency { get; set; } |
Gets or sets the input mel’s highest frequency (12,000 Hz: full band at 24 kHz). |
double StftLossWeight { get; set; } |
Gets or sets λ, the auxiliary STFT loss’s weight (2.5). |
int ChannelSize { get; set; } |
Gets or sets c_G, the generator’s channels (32; UnivNet-c16 uses 16). |
int DiscriminatorWidthDivisor { get; set; } |
Gets or sets a divisor on the period discriminators’ widths (1: the paper’s). |
int HopSize { get; set; } |
The product of the actual LVC upsampling strides (256 samples in the paper). |
int InferencePaddingFrames { get; set; } |
Gets or sets the log(1e-5) frames appended at synthesis and trimmed from the waveform (10). |
int KernelPredictorConvSize { get; set; } |
Gets or sets the kernel predictor’s convolution size (3). |
int KernelPredictorHidden { get; set; } |
Gets or sets the kernel predictor’s hidden channels (64). |
int NoiseDim { get; set; } |
Gets or sets the noise channels (64). |
int ResolutionDiscriminatorChannels { get; set; } |
Gets or sets the resolution discriminators’ channels (32). |
int SamplingSeed { get; set; } |
Gets or sets the seed of the training draws and of the synthesis noise. |
int SegmentSize { get; set; } |
Gets or sets the training segment in samples (16,384). |
int WindowSize { get; set; } |
Gets or sets the analysis window of the input features (1024). |
int[] Dilations { get; set; } |
Gets or sets the dilations of each LVC stack (1, 3, 9, 27). |
int[] DiscriminatorPeriods { get; set; } |
Gets or sets the period discriminators’ periods (2, 3, 5, 7, 11). |
int[] PeriodDiscriminatorChannels { get; set; } |
Gets or sets the period discriminators’ widths (64, 128, 256, 512, 1024). |
int[] StftFftSizes { get; set; } |
Gets or sets the STFT FFT sizes of the resolution discriminators and the auxiliary loss (1024, 2048, 512). |
int[] StftHopSizes { get; set; } |
Gets or sets the STFT hops (120, 240, 50). |
int[] StftWindowSizes { get; set; } |
Gets or sets the STFT windows (600, 1200, 240). |
long PretrainingSteps { get; set; } |
Gets or sets the generator-only steps (200,000). |