train(self,
emissions,
max_iterations=None,
convergence_logprob=None,
logger=None,
processes=1,
save=True,
save_intermediate=False)
| source code
|
Performs unsupervised training using Baum-Welch EM.
This is an instance method, because it is performed on a model that
has already been initialized. You might, for example, create such a model
using initialize_chord_types.
This is based on the training procedure in NLTK for HMMs:
nltk.tag.hmm.HiddenMarkovModelTrainer.train_unsupervised.
- Parameters:
emissions (list of lists of emissions) - training data. Each element is a list of emissions representing a
sequence in the training data. Each emission is an emission like
those used for jazzparser.misc.raphsto.RaphstoHmm.emission_log_probability,
i.e. a list of note observations
max_iterations (int) - maximum number of iterations to allow for EM (default 100).
Overrides the corresponding module option
convergence_logprob (float) - maximum change in log probability to consider convergence to have
been reached (default 1e-3). Overrides the corresponding module
option
logger (logging.Logger) - a logger to send progress logging to
processes (int) - number processes to spawn. A pool of this many processes will be
used to compute distribution updates for sequences in parallel
during each iteration.
save (bool) - save the model at the end of training
save_intermediate (bool) - save the model after each iteration. Implies save
- Overrides:
RaphstoBaumWelchTrainer.train
|