Package jazzparser :: Package taggers :: Package segmidi :: Package chordclass :: Module train :: Class ChordClassBaumWelchTrainer
[hide private]
[frames] | no frames]

Class ChordClassBaumWelchTrainer

source code

object --+
         |
        ChordClassBaumWelchTrainer

Class with methods to retrain a chordclass model using the Baum-Welch EM algorithm.

Module options must be processed already - we do that in the ChordClassTaggerModel, not here.


To Do: Inherit from the jazzparser.utils.nltk.ngram.baumwelch.BaumWelchTrainer. Currently, the generic trainer duplicates a lot of this code, since it was based on it.

Instance Methods [hide private]
 
__init__(self, model, options={})
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
train(self, emissions, logger=None, save_callback=None)
Performs unsupervised training using Baum-Welch EM.
source code
 
update_model(self, model)
Replaces the distributions of the saved model with those of the given model and saves it.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  OPTIONS = [ModuleOption('max_iterations', filter= int, help_te...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, model, options={})
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

train(self, emissions, logger=None, save_callback=None)

source code 

Performs unsupervised training using Baum-Welch EM.

This is performed on a model that has already been initialized. You might, for example, create such a model using jazzparser.taggers.segmidi.chordclass.hmm.ChordClassHmm.initialize_chord_classes.

This is based on the training procedure in NLTK for HMMs: nltk.tag.hmm.HiddenMarkovModelTrainer.train_unsupervised.

Parameters:

Class Variable Details [hide private]

OPTIONS

Value:
[ModuleOption('max_iterations', filter= int, help_text= "Number of tra\
ining iterations to give up after " "if we don't reach convergence bef\
ore.", usage= "max_iterations=N, where N is an integer", default= 100)\
, ModuleOption('convergence_logprob', filter= float, help_text= "Diffe\
rence in overall log probability of the " "training data made by one i\
teration after which we " "consider the training to have converged.", \
usage= "convergence_logprob=X, where X is a small floating " "point nu\
mber (e.g. 1e-3)", default= 1e-3), ModuleOption('split', filter= int, \
...