dwysocki / hidden-markov-music

Generate original musical scores by means of a hidden Markov model.
MIT License
6 stars 1 forks source link

Initialize flag for train subcommand #1

Closed dwysocki closed 9 years ago

dwysocki commented 9 years ago

Currently one must first run the init subcommand to create the initial HMM, and then use the train subcommand to perform training via Baum-Welch. This has its uses (you don't want train to always work from scratch, you might want to re-train a model), but is often inconvenient, and is in fact inhibiting to another feature that must be added.

For this reason, I must include an --init MODE option in the train subcommand. I think this is analogous to git checkout -b new-branch being a shortcut for git branch new-branch && git checkout new-branch. When this flag is used, no model is read from stdin, and the functionality of the init subcommand is performed. init currently takes a single positional argument, which specifies the probability distribution, either uniform or random, and that will have to be provided to the --init option as well.

dwysocki commented 9 years ago

Instead of taking the approach of combining init and train, I have elected to create a new subcommand, auto-train, which implements the desired functionality.