Accompanying repository for my paper: Improving Polyphonic Music Models with Feature-Rich Encoding
Requirements:
- Python 3 (tested with 3.6.5)
- Pytorch (tested with 1.2.0)
- Music21
Prepare Dataset:
To prepare the vanilla JSB Chorales dataset with canonical train/validation/test split:
python main.py --gen_dataset
To prepare dataset augmented with JS Fake Chorales:
python main.py --gen_dataset --jsf
To prepare dataset for training on JS Fake Chorales only:
python main.py --gen_dataset --jsf_only
Train Model from Scratch:
First run --gen_dataset
with any optional 2nd argument, then:
python main.py --train
Training requires 60 epochs, taking roughly 3-6 hours on GPU
Evaluate Pre-trained Model on Test Set:
python main.py --eval_nn
Sample with Pre-trained Model (via random sampling):
python main.py --sample