DACOptions

Options & Configuration · AiDotNet.Audio.Effects

Options for DAC, the Descript Audio Codec (“High-Fidelity Audio Compression with Improved RVQGAN”, Kumar et al. 2023). The defaults are the paper’s 44.1 kHz model: strides (2, 4, 8, 8), decoder width 1536, nine 1024-entry codebooks with 8-dimensional factorized codes (about 7.75 kbps), quantizer dropout, and the multi-period plus multi-band multi-scale STFT discriminators.

Inheritance: ModelOptions → NeuralAudioCodecOptions → DACOptions

For Beginners

DAC turns 44.1 kHz audio into about 86 frames of codes per second and back, at high fidelity for speech, music and general sounds. Fewer codebooks give a lower bitrate.

Constructors

Constructor Summary
DACOptions() Creates the paper’s 44.1 kHz configuration.

Properties

Property Summary
bool CodebookLossesOnRawVectors { get; set; } Gets or sets whether the codebook and commitment losses compare raw vectors (the reference code) rather than L2-normalized ones (App.
double AdversarialLossWeight { get; set; } Gets or sets the adversarial weight (1).
double Beta1 { get; set; } Gets or sets AdamW’s β1 (0.8).
double Beta2 { get; set; } Gets or sets AdamW’s β2 (0.9; the reference configuration uses 0.99).
double CodebookLossWeight { get; set; } Gets or sets the codebook loss weight (1).
double CommitmentLossWeight { get; set; } Gets or sets the commitment loss weight (0.25).
double FeatureLossWeight { get; set; } Gets or sets the feature-matching weight (2).
double LearningRate { get; set; } Gets or sets AdamW’s learning rate (1e-4).
double LearningRateDecay { get; set; } Gets or sets the learning rate’s decay per step (γ = 0.999996).
double MelLossWeight { get; set; } Gets or sets the multi-scale mel loss weight (15).
double QuantizerDropout { get; set; } Gets or sets the probability that a training example uses n_q ~ U[1, N_q] codebooks (1.0: the proposed model’s quantizer dropout).
double WeightDecay { get; set; } Gets or sets AdamW’s weight decay (0.01: PyTorch’s default, which the reference keeps).
double[] DiscriminatorBands { get; set; } Gets or sets the STFT discriminator’s band edges as fractions of the bins (0, .1, .25, .5, .75, 1).
int Channels { get; set; } The mono waveform channel used by the paper encoder and decoder.
int CodebookDim { get; set; } Gets or sets the factorized code dimension M (8).
int DecoderDim { get; set; } Gets or sets the decoder width (1536).
int DiscriminatorChannels { get; set; } Gets or sets the STFT discriminator’s channels (32; reference).
int DiscriminatorWidthDivisor { get; set; } Gets or sets a divisor on the period discriminators’ widths (1: the paper’s).
int EncoderDim { get; set; } Gets or sets the encoder’s first width (64; reference).
int LatentDim { get; set; } Gets or sets the latent dimension (0: the encoder’s final width, EncoderDim · 2^blocks = 1024; reference).
int[] DecoderRates { get; set; } Gets or sets the decoder rates (8, 8, 4, 2).
int[] DiscriminatorPeriods { get; set; } Gets or sets the multi-period discriminator’s periods (2, 3, 5, 7, 11).
int[] DiscriminatorWindows { get; set; } Gets or sets the multi-scale STFT discriminator’s windows (2048, 1024, 512; hop a quarter).
int[] EncoderRates { get; set; } Gets or sets the encoder strides (2, 4, 8, 8).
int[] MelBins { get; set; } Gets or sets the mel bins per window (5, 10, 20, 40, 80, 160, 320).
int[] MelWindows { get; set; } Gets or sets the mel losses’ windows (32 … 2048; hop a quarter).