tempo_net¶
Classes
|
Lightweight CNN that maps a raw waveform to a single BPM value. |
- class TempoNet(n_mels=128, sample_rate=22050, hop_length=512, dropout=0.3, n_outputs=1)[source]¶
Bases:
ModuleLightweight CNN that maps a raw waveform to a single BPM value.
Internally applies a log-mel spectrogram transform before the CNN.
Input: (B, 1, T) Output: (B,)
- Parameters:
n_mels (int) – Number of mel filterbanks.
sample_rate (int) – Audio sample rate, used to build the mel transform.
hop_length (int) – Hop length for the mel transform.
dropout (float) – Dropout probability in the regression head.
n_outputs (int) – Output dimension.
1for scalar regression; > 1 for classification over tempo bins (returns logits without softmax).