Wav2Vec2Options
Options & Configuration · AiDotNet.Audio.Foundations
Configuration options for the wav2vec 2.0 self-supervised speech model.
Inheritance: ModelOptions → Wav2Vec2Options
For Beginners
wav2vec 2.0 pioneered self-supervised learning for speech. It listens to raw audio, masks parts of it, and learns to predict the missing parts. This teaches it a deep understanding of speech that can then be used for tasks like transcription with very little labeled data.
How It Works
wav2vec 2.0 (Baevski et al., 2020, Meta) learns speech representations via contrastive learning over quantized speech units. Pre-trained on 960 hours of LibriSpeech, it achieves WER 1.8% on test-clean with only 10 minutes of labeled data when fine-tuned for ASR.
Constructors
| Constructor | Summary |
|---|---|
Wav2Vec2Options() |
Properties
| Property | Summary |
|---|---|
OnnxModelOptions OnnxOptions { get; set; } |
Gets or sets the ONNX runtime options. |
bool StableLayerNorm { get; set; } |
Gets or sets whether the network is the LARGE-LV60 form: layer norm in every feature-encoder layer and pre-norm (“stable layer norm”) Transformer layers. |
double ContrastiveTemperature { get; set; } |
Gets or sets the contrastive temperature κ (0.1). |
double DiversityWeight { get; set; } |
Gets or sets the diversity loss weight α (0.1). |
double DropoutRate { get; set; } |
Gets or sets the Transformer dropout and the dropout at the feature encoder’s output (0.1). |
double FeatureGradientScale { get; set; } |
Gets or sets the factor on the feature encoder’s gradients in pre-training (0.1). |
double FeaturePenaltyWeight { get; set; } |
Gets or sets the weight of the L2 penalty on the feature encoder’s output (10). |
double LayerDrop { get; set; } |
Gets or sets the probability of skipping a Transformer layer in training (0.05 BASE, 0.2 LARGE). |
double LearningRate { get; set; } |
Gets or sets the learning rate used when no paper recipe applies. |
double MaskProbability { get; set; } |
Gets or sets the probability a frame starts a masked span (0.065) of MaskLength frames. |
int CodevectorDim { get; set; } |
Gets or sets the quantized vector’s width, d (256; the codebook entries are d/G wide). |
int FeatureEncoderDim { get; set; } |
Gets or sets the CNN feature encoder output dimension. |
int FeedForwardDim { get; set; } |
Gets or sets the feed-forward dimension. |
int HiddenDim { get; set; } |
Gets or sets the transformer hidden dimension. |
int MaskLength { get; set; } |
Gets or sets the masked span length M (10). |
int NumAttentionHeads { get; set; } |
Gets or sets the number of attention heads. |
int NumLayers { get; set; } |
Gets or sets the number of transformer layers. |
int NumNegatives { get; set; } |
Gets or sets the number of distractors per masked step, K (100). |
int NumQuantizationGroups { get; set; } |
Gets or sets the number of quantization codebooks, G (2). |
int ProjectedCodevectorDim { get; set; } |
Gets or sets the width the context and quantized vectors are projected to (256 BASE, 768 LARGE). |
int QuantizationCodebookSize { get; set; } |
Gets or sets the number of entries per codebook, V (320). |
int SampleRate { get; set; } |
Gets or sets the expected audio sample rate in Hz. |
string ModelPath { get; set; } |
Gets or sets the path to the ONNX model file. |
string Variant { get; set; } |
Gets or sets the model variant (“base” or “large”). |