PANNsModelOptions

Options & Configuration · AiDotNet.Models.Options

Configuration options for PANNs (Pretrained Audio Neural Networks) models (Kong et al. 2020).

Inheritance: ModelOptions → NeuralNetworkOptions → ModelHyperparameterOptions → AudioNeuralNetworkOptions → PANNsModelOptions

For Beginners

PANNs is a family of pretrained convolutional networks for audio tagging. CNN14 is the canonical balanced-accuracy variant. The defaults here reproduce the AudioSet-pretrained checkpoint; you usually only override NumClasses when fine-tuning on a different label set.

How It Works

Defaults follow the published CNN14 recipe (Kong et al. 2020 §3): 64 mel bands spanning 50-14000 Hz, 32 kHz sample rate, 1024-sample STFT window, 320-sample hop, six CNN stages (64→128→256→512→1024→2048 channels), temporal pooling, an embedding head, and a 527-class AudioSet classifier.

Constructors

Constructor Summary
PANNsModelOptions() Initializes a new instance with PANNs CNN14 defaults.
PANNsModelOptions(PANNsModelOptions other) Initializes a new instance by copying every property from other.

Properties

Property Summary
bool EnableGradientClipping { get; set; } Whether the native Adam optimizer clips the global gradient norm.
double DropoutRate { get; set; } Dropout rate inside the CNN blocks.
double HeadDropoutRate { get; set; } Dropout rate used around the fully connected embedding head.
double LearningRate { get; set; } Adam learning rate used for native training.
double MaxFrequency { get; set; } Highest frequency represented by the mel filterbank, in Hz.
double MaxGradientNorm { get; set; } Maximum global gradient norm when clipping is enabled.
double MinFrequency { get; set; } Lowest frequency represented by the mel filterbank, in Hz.
int BaseChannels { get; set; } Number of channels in the first CNN14 convolution block.
int EmbeddingDim { get; set; } Embedding dimension produced before the classification head.
int HopLength { get; set; } STFT hop length in samples between successive frames.
int NumBlocks { get; set; } Number of double-convolution blocks in the native PANNs backbone.
int NumClasses { get; set; } Number of output classes for the classification head.
int NumMelBands { get; set; } Number of mel filterbank bands per spectrogram frame.
int SampleRate { get; set; } Audio sample rate in Hz used by the STFT frontend.
int StftWindowSize { get; set; } STFT window size in samples (analysis frame length).