Predicting the label

Prediction of the label can be made by calling the following method:

def predict(self, test_X):    with self.tf_graph.as_default():        with tf.Session() as self.tf_session:            self.tf_saver.restore(self.tf_session, self.model_path)            feed = {                self.input_data: test_X,                self.keep_prob: 1            }            return self.mod_y.eval(feed)

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.