Before training the models, the data must reformatted so that there are 12 training, 1 validation and 3 testing parts.
From the project root directory, navigate to the scripts directory.
cd src/scripts
Run the splitdata.sh script and pass in the path to the MagnaTagATune dataset.
./splitdata.sh <path-to-magnatagatune>
Change directory to utils
cd ../utils
Run python script to update annotation files to reflect changes to train, val, test split.
python create_test_val.py --annotations-path=<path-to-magnatagatune-annotations>
Within the MagnaTagATune dataset samples directory, there should be train, val and test directories.
Our model which replicates the CNN architecture from the Dieleman and Schrauwen can be found in src/CNN/.
From the project root directory run locally using:
python src/CNN/runner.py
Edit Line 18 of train.sh
with correct data path and desired hyperparameters.
To run on BC4 with Slurm:
cd src/CNN/
sbatch train.sh
Our improved model which replicates the CRNN architecture from Choi et al. can be found in src/CRNN/.
Before running this model. The spectrogram data must be generated from the original raw audio signals. To do this, run:
python src/utils/spectrogram.py <path-to-magnatagatune>
From the project root directory run locally using:
python src/CRNN/runner.py
Edit Line 18 of train.sh
with correct data path and desired hyperparameters.
To run on BC4 with Slurm:
cd src/CRNN/
sbatch train.sh