O'Reilly logo

Neural Network Programming with TensorFlow by Rajdeep Dua, Manpreet Singh Ghotra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required