(self, obs)
return output, pol_sigma, pol_prec, pol_det_sigma
Run policy forward.
        Args:
            obs: Numpy array of observations that is N x T x dO.
Run policy forward.
        Args:
            obs: Numpy array of observations that is N x T x dO.
Run policy forward . Args : obs : Numpy array of observations that is N x T x dO .
def prob(self, obs):
        """
        Run policy forward.
        Args:
            obs: Numpy array of observations that is N x T x dO.
        """
        dU = self._dU
        N, T = obs.shape[:2]

        # Normalize obs.
        if self.policy.scale is not None:
            # TODO: Should prob be called before update?
            for n in range(N):
                obs[n, :, self.x_idx] = (obs[n, :, self.x_idx].T.dot(self.policy.scale)
                                         + self.policy.bias).T

        output = np.zeros((N, T, dU))

        for i in range(N):
            for t in range(T):
                # Feed in data.
                feed_dict = {self.obs_tensor: np.expand_dims(obs[i, t], axis=0)}
                with tf.device(self.device_string):
                    output[i, t, :] = self.sess.run(self.act_op, feed_dict=feed_dict)

        pol_sigma = np.tile(np.diag(self.var), [N, T, 1, 1])
        pol_prec = np.tile(np.diag(1.0 / self.var), [N, T, 1, 1])
        pol_det_sigma = np.tile(np.prod(self.var), [N, T])

        return output, pol_sigma, pol_prec, pol_det_sigma
def prob ( self , obs ) : dU = self . _dU N , T = obs . shape [ : 2 ] # Normalize obs. if self . policy . scale is not None : # TODO: Should prob be called before update? for n in range ( N ) : obs [ n , : , self . x_idx ] = ( obs [ n , : , self . x_idx ] . T . dot ( self . policy . scale ) + self . policy . bias ) . T output = np . zeros ( ( N , T , dU ) ) for i in range ( N ) : for t in range ( T ) : # Feed in data. feed_dict = { self . obs_tensor : np . expand_dims ( obs [ i , t ] , axis = 0 ) } with tf . device ( self . device_string ) : output [ i , t , : ] = self . sess . run ( self . act_op , feed_dict = feed_dict ) pol_sigma = np . tile ( np . diag ( self . var ) , [ N , T , 1 , 1 ] ) pol_prec = np . tile ( np . diag ( 1.0 / self . var ) , [ N , T , 1 , 1 ] ) pol_det_sigma = np . tile ( np . prod ( self . var ) , [ N , T ] ) return output , pol_sigma , pol_prec , pol_det_sigma