'Predict the labels on a single batch of examples.
Args:
sess: A Tensorflow Session.
x: A batch of images.
y: The labels for the images in x.
This allows for updating the memory.
Returns:
Predicted y.'

def predict(self, sess, x, y=None):

    cur_memory = sess.run([self.mem_keys, self.mem_vals, self.mem_age])
    outputs = [self.y_preds]
    if (y is None):
        ret = sess.run(outputs, feed_dict={self.x: x})
    else:
        ret = sess.run(outputs, feed_dict={self.x: x, self.y: y})
    sess.run([self.mem_reset_op], feed_dict={self.mem_keys_reset: cur_memory[0], self.mem_vals_reset: cur_memory[1], self.mem_age_reset: cur_memory[2]})
    return ret
