Pretraining the DBN

In this section, we look at how a DBN is pretrained:

class RBM(UnsupervisedModel):...  def pretrain(self, train_set, validation_set=None):    """Perform Unsupervised pretraining of the DBN."""    self.do_pretrain = True    def set_params_func(rbmmachine, rbmgraph):    params = rbmmachine.get_parameters(graph=rbmgraph)     self.encoding_w_.append(params['W'])     self.encoding_b_.append(params['bh_'])    return SupervisedModel.pretrain_procedure(     self, self.rbms, self.rbm_graphs, set_params_func=set_params_func,     train_set=train_set, validation_set=validation_set)

This in turn calls SupervisedModel.pretrain_procedure(..), which takes the following parameters:

  • layer_objs: A list of model objects (autoencoders or RBMs)
  • layer_graphs: A list of model ...

Get Neural Network Programming with TensorFlow now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.