ContextNetOptions
Options & Configuration · AiDotNet.SpeechRecognition.ConformerFamily
Options for ContextNet CNN encoder with squeeze-and-excitation (Han et al., 2020).
Inheritance: ModelOptions → ContextNetOptions
For Beginners
These options configure the ContextNet model. Default values follow the original paper’s recommended settings for optimal speech recognition accuracy.
Constructors
| Constructor | Summary |
|---|---|
ContextNetOptions() |
Initializes a new instance with default values. |
ContextNetOptions(ContextNetOptions other) |
Initializes a new instance by copying from another instance. |
Properties
| Property | Summary |
|---|---|
OnnxModelOptions OnnxOptions { get; set; } |
Gets or sets the ONNX Runtime settings used when the model is loaded from an ONNX file. |
double DropoutRate { get; set; } |
Gets or sets the dropout probability of the native layers during training. |
double WidthScaling { get; set; } |
Width multiplier alpha applied to every channel group. |
int EncoderDim { get; set; } |
Nominal encoder width. |
int KernelSize { get; set; } |
Depthwise convolution kernel size. |
int MaxAudioLengthSeconds { get; set; } |
Gets or sets the longest clip, in seconds, of the reference configuration. |
int NumBlocks { get; set; } |
Number of convolution blocks. |
int NumMels { get; set; } |
Gets or sets the number of mel filterbank channels in the input features. |
int NumSubBlocks { get; set; } |
Number of convolution layers inside each interior block. |
int SampleRate { get; set; } |
Gets or sets the sample rate, in Hz, that input audio is expected at. |
int SqueezeExcitationRatio { get; set; } |
Reduction ratio of the squeeze-and-excitation bottleneck. |
int VocabSize { get; set; } |
Output vocabulary size; must equal Vocabulary’s length. |
string Language { get; set; } |
Gets or sets the language code (for example “en”) reported for a transcript when none is passed or detected. |
string ModelPath { get; set; } |
Gets or sets the path of the pretrained ONNX model. |
string[] Vocabulary { get; set; } |
The token strings, indexed by token id. |
Methods
| Method | Summary |
|---|---|
void Validate() |
Validates the configuration. |