Class initialization

In DBN initialization, the Model class's initialization method __init__(self, name) is called. The Model class references the following:

  • Input data: self.input_data
  • Input labels: self.input_labels
  • Cost: self.cost
  • Number of nodes in final layer: self.layer_nodes
  • TensorFlow session: self.tf_session
  • TensorFlow graph: self.tf_graph= tf.graph
class Model(object):    """Class representing an abstract Model."""    def __init__(self, name):        """Constructor.        :param name: name of the model, used as filename.            string, default 'dae'        """        self.name = name        self.model_path = os.path.join(Config().models_dir, self.name)        self.input_data = None        self.input_labels = None>        self.keep_prob = None        self.layer_nodes = []  # list of layers of the final ...

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.