Incorporating phone info

Vincent published a blog post on how to use the Pylearn2 TIMIT class with multiple sources, specifically combining acoustic samples and phones information. I tried using the example yaml file and model subclasses but got the following error. I made sure that pylearn2, theano, and Vincent’s TIMIT class were all up to date.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-99a022070172> in <module>()
      1 train = yaml_parse.load(train)
----> 2train.main_loop()

/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pylearn2/pylearn2/train.pyc in main_loop(self, time_budget)
    153                     break
    154         else:
--> 155self.algorithm.setup(model=self.model, dataset=self.dataset)
    156             self.setup_extensions()
    157             # Model.censor_updates is used by the training algorithm to

/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pylearn2/pylearn2/training_algorithms/sgd.pyc in setup(self, model, dataset)
    228         if getattr(model, "force_batch_size", False) and\
    229            any(dataset.get_design_matrix().shape[0] % self.batch_size != 0 for
--> 230                dataset in self.monitoring_dataset.values()) and \
    231            not has_uniform_batch_size(self.monitor_iteration_mode):
    232 

/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pylearn2/pylearn2/training_algorithms/sgd.pyc in <genexpr>((dataset,))
    228         if getattr(model, "force_batch_size", False) and\
    229            any(dataset.get_design_matrix().shape[0] % self.batch_size != 0 for
--> 230                dataset in self.monitoring_dataset.values()) and \
    231            not has_uniform_batch_size(self.monitor_iteration_mode):
    232 

AttributeError: 'TIMIT' object has no attribute 'get_design_matrix'

As a hack to get past this, I just commented out the offending line in sgd.py… Obviously this isn’t the best solution but it allowed me to at least run the example from Vincent’s post.

I then moved on to trying to adapt his example to work with the DBM class. I made a compositeDBM.yaml file and tried to write the necessary DBM subclasses to allow for specifying input sources, but I ran into some problems. The CompositeLayer class in the DBM module was originally extending the HiddenLayer class, whereas in this case I want to use it as a VisibleLayer. I’m not sure if it makes more sense to have a second class for a visible CompositeLayer, or to have one CompositeLayer class that extends the Layer class and can be used as either a visible or hidden layer. I have begun to implement the former solution but have not yet completed.

Leave a comment