A deep learning model which incorporates the transformer model as a backbone and develop complex attention and encoder/decoder network operating on complex-valued input. This model achieves state-of-the-art results on music transcription tasks.
Title: Complex Transformer: A Framework for Modeling Complex-Valued Sequence
Arxiv: https://arxiv.org/abs/1910.10202
python: python=3.6
cuda : cuda>=9.0
packages: pip install numpy scipy sklearn intervaltree resampy torch
This code base relies on GPUs and cuda.
cd music/
wget https://homes.cs.washington.edu/~thickstn/media/musicnet.npz
python3 -u resample.py musicnet.npz musicnet_11khz.npz 44100 11000
rm musicnet.npz
python3 -u parse_file.py
rm musicnet_11khz.npz
cd ..
(This process is quite long)
Preprocess the MusicNet dataset as stated in the paper:
python parse_file.py
Sample command line for automatic music transcription:
python -u transformer/train.py
Concatenated transformer for automatic music transcription:
python -u transformer/train_concat.py
For MusicNet generation tasks:
python -u transformer/train_gen.py
Concatenated transformer for MusicNet generation:
python -u transformer/train_gen_concat.py
For IQ classification task:
python -u transformer/train_iq.py
Concatenated transformer for IQ classification task:
python -u transformer/train_iq_concat.py
For IQ generation tasks:
python -u transformer/train_gen_iq.py
Concatenated transformer for IQ generation:
python -u transformer/train_gen_iq_concat.py
LSTM for MusicNet generation:
python -u lstm_music_gen.py
LSTM for IQ generation:
python -u lstm_iq_gen.py
Example: python -u transformer_train.py --path PATH
All the parameters you can tune are in the argparser section of train*.py or lstm*.py file.