FreGradOptions

Options & Configuration · AiDotNet.TextToSpeech.Vocoders

Options for FreGrad (Nguyen et al. 2024): a lightweight diffusion vocoder that denoises the two Haar wavelet sub-bands of the waveform with frequency-aware dilated convolutions, a separate energy prior per band, a zero-terminal-SNR schedule and a multi-resolution STFT magnitude loss.

Inheritance: ModelOptions → TtsModelOptions → VocoderOptions → DiffWaveOptions → PriorGradOptions → FreGradOptions

For Beginners

These options configure the FreGrad model. Default values follow the original paper settings.

How It Works

Defaults are the paper’s (§3–4.1): 30 frequency-aware residual blocks with a dilation cycle of 7 and 32 channels; DiffWave’s step embedding and mel upsampler with the upsampling halved (16 × 8 = 128 per frame on the half-length sub-bands); the β schedule Linear(1e-4, 0.05, 50) shifted to zero terminal SNR with γ = 1e-4 (Eq. 8); a prior per band from the lower and upper halves of the mel bands with PriorGrad’s energy normalization; the loss Σ_{l,h} L_diff + 0.1 · L_mag with L_mag the log-magnitude term of a 3-resolution STFT loss (FFT 512, 1024, 2048; windows 240, 600, 1200); 22.05 kHz audio, 80 mel bands from a 1024-point FFT with hop 256 between 80 Hz and 8 kHz; Adam (0.9, 0.999) at 2e-4, batch 16; 50 sampling steps.

What the paper leaves open follows kaistmm/fregrad and the works it cites: the STFT loss hops 50, 120, 240 (Parallel WaveGAN’s, whose resolutions the paper’s FFT and window sizes are); the feature pipeline, energy statistics and 62-frame crops of PriorGrad’s reference; no gradient clipping; each sampling step clamped to [−1, 1]. The reference’s biquad filtering of the priors and of the sampled sub-bands is not in the paper and is not applied.

Constructors

Constructor Summary
FreGradOptions() Creates the paper’s FreGrad configuration.
FreGradOptions(FreGradOptions other) Initializes a new instance by copying from another instance.

Properties

Property Summary
double MagnitudeLossWeight { get; set; } Gets or sets the weight λ of the STFT magnitude loss (0.1).
int HopSize { get; set; } The waveform hop: twice the spectrogram upsampler’s stride product, because the DWT halves time.
int[] StftFftSizes { get; set; } Gets or sets the STFT loss FFT sizes (512, 1024, 2048).
int[] StftHopSizes { get; set; } Gets or sets the STFT loss hops (50, 120, 240).
int[] StftWindowSizes { get; set; } Gets or sets the STFT loss windows (240, 600, 1200).

Methods

Method Summary
double[] ZeroTerminalSnr(double[] betas, double gamma) The β schedule whose √ᾱ is shifted to reach (nearly) zero at the last step (Eq.