(self, obs_segments, act_segments, network)
return tf.reshape(rewards, (batchsize, segment_length))
:param obs_segments: tensor with shape = (batch_size, segment_length) + obs_shape
        :param act_segments: tensor with shape = (batch_size, segment_length) + act_shape
        :param network: neural net with .run() that maps obs and act tensors into a (scalar) value tensor
        :return: tensor with shape = (batch_size, segment_length)
:param obs_segments: tensor with shape = (batch_size, segment_length) + obs_shape
        :param act_segments: tensor with shape = (batch_size, segment_length) + act_shape
        :param network: neural net with .run() that maps obs and act tensors into a (scalar) value tensor
        :return: tensor with shape = (batch_size, segment_length)
: param obs_segments : tensor with shape = ( batch_size segment_length ) + obs_shape : param act_segments : tensor with shape = ( batch_size segment_length ) + act_shape : param network : neural net with . run () that maps obs and act tensors into a ( scalar ) value tensor : return : tensor with shape = ( batch_size segment_length )
def _predict_rewards(self, obs_segments, act_segments, network):
        """
        :param obs_segments: tensor with shape = (batch_size, segment_length) + obs_shape
        :param act_segments: tensor with shape = (batch_size, segment_length) + act_shape
        :param network: neural net with .run() that maps obs and act tensors into a (scalar) value tensor
        :return: tensor with shape = (batch_size, segment_length)
        """
        batchsize = tf.shape(obs_segments)[0]
        segment_length = tf.shape(obs_segments)[1]

        # Temporarily chop up segments into individual observations and actions
        obs = tf.reshape(obs_segments, (-1,) + self.obs_shape)
        acts = tf.reshape(act_segments, (-1,) + self.act_shape)

        # Run them through our neural network
        rewards = network.run(obs, acts)

        # Group the rewards back into their segments
        return tf.reshape(rewards, (batchsize, segment_length))
def _predict_rewards ( self , obs_segments , act_segments , network ) : batchsize = tf . shape ( obs_segments ) [ 0 ] segment_length = tf . shape ( obs_segments ) [ 1 ] # Temporarily chop up segments into individual observations and actions obs = tf . reshape ( obs_segments , ( - 1 , ) + self . obs_shape ) acts = tf . reshape ( act_segments , ( - 1 , ) + self . act_shape ) # Run them through our neural network rewards = network . run ( obs , acts ) # Group the rewards back into their segments return tf . reshape ( rewards , ( batchsize , segment_length ) )