import tensorflow as tf

        
            # loss and optimizer
            self.loss = tf.reduce_mean(tf.square(tf.subtract(self.value_estimate, self.target)))
            self.optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate)
            self.train_op = self.optimizer.minimize(
                self.loss, global_step=tf.contrib.framework.get_global_step())        
    
    def predict(self, state, sess=None):
        sess = sess or tf.get_default_session()
        return sess.run(self.value_estimate, { self.state: [state] })[0][0]
