(self, path)
return q_value[0]
Predict the reward for each step in a given path
Predict the reward for each step in a given path
Predict the reward for each step in a given path
def predict_reward(self, path):
        """Predict the reward for each step in a given path"""
        with self.graph.as_default():
            q_value = self.sess.run(self.q_value, feed_dict={
                self.segment_obs_placeholder: np.asarray([path["obs"]]),
                self.segment_act_placeholder: np.asarray([path["actions"]]),
                K.learning_phase(): False
            })
        return q_value[0]
def predict_reward ( self , path ) : with self . graph . as_default ( ) : q_value = self . sess . run ( self . q_value , feed_dict = { self . segment_obs_placeholder : np . asarray ( [ path [ "obs" ] ] ) , self . segment_act_placeholder : np . asarray ( [ path [ "actions" ] ] ) , K . learning_phase ( ) : False } ) return q_value [ 0 ]