source code for the 2024 LAMIR beat tracking tutorial.
in this repo, we implement a PyTorch version of the TCN proposed by Sebastian Böck and Matthew E. P. Davies in the paper "DECONSTRUCT, ANALYSE, RECONSTRUCT: HOW TO IMPROVE TEMPO, BEAT, AND DOWNBEAT ESTIMATION".
code authored by Giovana Morais
config.py: hyperparameters for training and finetuning.dataloader.py: dataloader for audio and beat datamodel.py: torch beat tracking modelpl_model.py: pytorch lightning modeltrain.py: training scriptfinetune.py: finetuning script
pip install -r requirements.txtalter whatever hyperparameters you with on the PARAMS_TRAIN inside config.py
python train.pywe provide one pre-trained model for the finetuning. to use it, keep the
PARAMS_FINETUNE dictionary as is.
if you trained a new model and want to use it, please make sure to update the
CHECKPOINT_NAME variable in the config.py file accordingly.
PARAMS_FINETUNE = {
"MAX_NUM_FILES": 5,
"LEARNING_RATE": 0.005,
"N_FILTERS": 20,
"KERNEL_SIZE": 5,
"DROPOUT": 0.15,
"N_DILATIONS": 11,
"N_EPOCHS": 5,
"LOSS": "BCE",
"NUM_WORKERS": 7,
# Change here with your checkpoint filename
"CHECKPOINT_FILE": <new_filename>
}run the script by specifying which dataset you want to finetune it:
python finetune.py --dataset=brid
# or
python finetune.py --dataset=candombeif you want to download the datasets, just provide the --download flag
python finetune.py --dataset=brid --download
# or
python finetune.py --dataset=candombe --downloadNOTE: this will run the download with force_overwrite.