HiFiGANOptions

Options & Configuration · AiDotNet.TextToSpeech.Vocoders

Options for HiFi-GAN (Kong et al. 2020).

Inheritance: ModelOptions → TtsModelOptions → VocoderOptions → HiFiGANOptions

For Beginners

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

How It Works

Defaults are HiFi-GAN V1 (Table 5) with the values the paper leaves to its reference implementation (jik876/hifi-gan config_v1.json, meldataset.py): upsampling rates 8, 8, 2, 2 with kernels 16, 16, 4, 4 from 512 channels; residual block type 1 with kernels 3, 7, 11 and dilations (1, 3, 5) each; discriminator periods 2, 3, 5, 7, 11 and three scales; 8192-sample training segments; 22.05 kHz, 1024-point FFT and window, hop 256, 80 mel bins up to 8 kHz (the loss mel spans the full band); λ_fm = 2, λ_mel = 45; AdamW at 2e-4 decayed 0.999 per epoch.

Constructors

Constructor Summary
HiFiGANOptions() Creates HiFi-GAN V1.
HiFiGANOptions(HiFiGANOptions other) Initializes a new instance by copying from another instance.

Properties

Property Summary
double FeatureMatchingWeight { get; set; } Gets or sets λ_fm, the feature-matching weight (2).
double LearningRateDecay { get; set; } Gets or sets the per-epoch learning-rate decay (0.999).
double MelLossWeight { get; set; } Gets or sets λ_mel, the mel-spectrogram loss weight (45).
double MelMaxFrequency { get; set; } Gets or sets the highest frequency of the input mel filterbank (8000 Hz).
int DiscriminatorWidthDivisor { get; set; } Gets or sets a divisor on every discriminator width (1: the paper’s 32–1024 channels).
int ResblockType { get; set; } Gets or sets the residual block type: 1 (two convolutions per dilation, V1/V2) or 2 (one, V3).
int SamplingSeed { get; set; } Gets or sets the seed of the segment crops, for repeatable runs.
int SegmentSize { get; set; } Gets or sets the training segment in samples (8192).
int UpdatesPerEpoch { get; set; } Gets or sets the updates in one epoch, over which the decay applies once (809: LJSpeech’s 12,950 clips at a batch of 16).
int WindowSize { get; set; } Gets or sets the STFT window length (1024).
int[] DiscriminatorPeriods { get; set; } Gets or sets the multi-period discriminator’s periods (2, 3, 5, 7, 11).
int[] UpsampleKernelSizes { get; set; } Gets or sets the transposed-convolution kernels (16, 16, 4, 4 for HiFi-GAN V1).
int[][] ResblockDilationSizes { get; set; } Gets or sets the dilations of each residual block’s convolutions ((1, 3, 5) for each kernel).