Skip to content

The implementation of the paper: The Simulated Emergence of Chord Function (Uehara and Tojo; EvoMUSART2021).

License

Notifications You must be signed in to change notification settings

yui-u/emerge-chord-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Simulated Emergence of Chord Function

This repository is the implementation of The Simulated Emergence of Chord Function (Uehara and Tojo; EvoMUSART2021) and the extended paper Chord Function Recognition as Latent State Transition (SN Computer Science 3:508 2022).

Requirements

Training

  • Set the flag --do_train for training.

Hidden Markov Models (HMM)

  • Set the model type to --model_type hmm for HMM.

Baseline HMM

  • Set the special flag for the baseline model: --base_model
python run_nhmm.py --model_type hmm --base_model --scale any --num_state 8 --seed 0 --device cpu --num_epochs 1000 --do_train

Neural HMM with all additional contexts

  • Additional contexts can be set by flags: --use_lstm, --use_histogram, --use_pitch
python run_nhmm.py --model_type hmm --use_lstm --use_histogram --use_pitch --scale any --num_state 8 --seed 0 --device cpu --num_epochs 1000 --do_train

Hidden Semi-Markov Models (HSMM)

  • Set the model type to --model_type hsmm for HSMM.

Baseline HSMM

  • Set the special flag for the baseline model: --base_model
python run_nhmm.py --model_type hsmm --base_model --scale any --num_state 8 --seed 0 --device cpu --num_epochs 500 --do_train

Neural HSMM with all additional contexts

  • Additional contexts can be set by flags: --use_lstm, --use_histogram, --use_pitch, --use_beat
  • Note that --use_beat can be set only for the Neural HSMM.
python run_nhmm.py --model_type hsmm --use_lstm --use_histogram --use_pitch --use_beat --scale any --num_state 8 --seed 0 --device cpu --num_epochs 500 --do_train

Evaluation and Visualizing

  • To evaluate a trained model, set these options and flags same to it: --model_type, --num_state, --base_model, --use_lstm, --use_histogram, --use_pitch, --use_beat
  • Specify a trained model by --model_to_eval <path to a model for evaluation> and set the flag --do_eval.
  • A scale for evaluating can be selected by --eval_scale from four options {any, major, minor, dorian}.

Sample of Evaluating Neural HSMM with the Major Scale

python run_nhmm.py --model_type hsmm --use_lstm --use_histogram --use_pitch --use_beat --eval_scale major --num_state 8 --do_eval --model_to_eval <path to a model for evaluation>

Samples of Our Trained Models

Samples of our trained models can be found at: trained_models

Note

Although the resulting values are similar, the latest code changes the way perplexity is averaged in the evaluation. For more information on this, see Appendix B of my thesis.

License and Reference

MIT License: LICENSE

About

The implementation of the paper: The Simulated Emergence of Chord Function (Uehara and Tojo; EvoMUSART2021).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages