(self, x, obs, t, noise)
return u[0]
Return an action for a state.
        Args:
            x: State vector.
            obs: Observation vector.
            t: Time step.
            noise: Action noise. This will be scaled by the variance.
Return an action for a state.
        Args:
            x: State vector.
            obs: Observation vector.
            t: Time step.
            noise: Action noise. This will be scaled by the variance.
Return an action for a state . Args : x : State vector . obs : Observation vector . t : Time step . noise : Action noise . This will be scaled by the variance .
def act(self, x, obs, t, noise):
        """
        Return an action for a state.
        Args:
            x: State vector.
            obs: Observation vector.
            t: Time step.
            noise: Action noise. This will be scaled by the variance.
        """

        # Normalize obs.
        if len(obs.shape) == 1:
            obs = np.expand_dims(obs, axis=0)
        obs[:, self.x_idx] = obs[:, self.x_idx].dot(self.scale) + self.bias
        with tf.device(self.device_string):
            action_mean = self.sess.run(self.act_op, feed_dict={self.obs_tensor: obs})
        if noise is None:
            u = action_mean
        else:
            u = action_mean + self.chol_pol_covar.T.dot(noise)
        return u[0]
def act ( self , x , obs , t , noise ) : # Normalize obs. if len ( obs . shape ) == 1 : obs = np . expand_dims ( obs , axis = 0 ) obs [ : , self . x_idx ] = obs [ : , self . x_idx ] . dot ( self . scale ) + self . bias with tf . device ( self . device_string ) : action_mean = self . sess . run ( self . act_op , feed_dict = { self . obs_tensor : obs } ) if noise is None : u = action_mean else : u = action_mean + self . chol_pol_covar . T . dot ( noise ) return u [ 0 ]