HTDemucsOptions

Options & Configuration · AiDotNet.Audio.SourceSeparation

Configuration options for the HTDemucs (Hybrid Transformer Demucs) model.

Inheritance: ModelOptions → HTDemucsOptions

For Beginners

HTDemucs is Meta’s best music separator. It works in two ways at once: one path processes the raw audio waves, another processes the frequency picture (spectrogram). A Transformer helps both paths share information, giving the best of both worlds.

How It Works

HTDemucs (Rouard et al., ICASSP 2023) is Meta’s hybrid architecture combining a temporal convolutional encoder with cross-domain Transformer attention. It operates on both waveform and spectrogram simultaneously, achieving 9.0 dB SDR on MUSDB18-HQ.

Constructors

Constructor Summary
HTDemucsOptions()

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 LearningRate { get; set; } Gets or sets the learning rate of the fallback AdamW optimizer.
double WeightDecay { get; set; } Gets or sets a weight decay that is not read: the paper trains with Adam and no weight decay, and the declared recipe follows it.
int FftSize { get; set; } Gets or sets the STFT window length in samples; the model rounds it up to a power of two.
int HopLength { get; set; } Gets or sets the number of samples between successive STFT frames.
int NumAttentionHeads { get; set; } Gets or sets the number of heads in each attention layer.
int NumChannels { get; set; } Gets or sets the number of audio channels of the reference configuration (2 for stereo).
int NumFreqBins { get; set; } Gets or sets the number of frequency bins per STFT frame (FftSize / 2 + 1).
int NumStems { get; set; } Gets or sets the number of stems the model separates.
int NumTransformerLayers { get; set; } Gets or sets the number of transformer layers.
int SampleRate { get; set; } Gets or sets the sample rate, in Hz, that input audio is expected at.
int TemporalKernelSize { get; set; } Gets or sets the temporal kernel size.
int TemporalStride { get; set; } Gets or sets the temporal stride.
int TransformerDim { get; set; } Gets or sets the hidden width of the transformer layers.
int[] EncoderChannels { get; set; } Gets or sets the encoder channel progression.
string ModelPath { get; set; } Gets or sets the path of the pretrained ONNX model.
string[] Sources { get; set; } Gets or sets the names of the separated stems, in output order.