(self, m, init=False)
Re-estimate the local policy values in the neighborhood of the
        trajectory.
        Args:
            m: Condition
            init: Whether this is the initial fitting of the policy.
Re-estimate the local policy values in the neighborhood of the
        trajectory.
        Args:
            m: Condition
            init: Whether this is the initial fitting of the policy.
Re - estimate the local policy values in the neighborhood of the trajectory . Args : m : Condition init : Whether this is the initial fitting of the policy .
def _update_policy_fit(self, m, init=False):
        """
        Re-estimate the local policy values in the neighborhood of the
        trajectory.
        Args:
            m: Condition
            init: Whether this is the initial fitting of the policy.
        """
        dX, dU, T = self.dX, self.dU, self.T
        # Choose samples to use.
        samples = self.cur[m].sample_list
        N = len(samples)
        pol_info = self.cur[m].pol_info
        X = samples.get_X()
        obs = samples.get_obs().copy()
        pol_mu, pol_sig = self.policy_opt.prob(obs)[:2]
        pol_info.pol_mu, pol_info.pol_sig = pol_mu, pol_sig

        # Update policy prior.
        policy_prior = pol_info.policy_prior
        if init:
            samples = SampleList(self.cur[m].sample_list)
            mode = self._hyperparams['policy_sample_mode']
        else:
            samples = SampleList([])
            mode = 'add' # Don't replace with empty samples
        policy_prior.update(samples, self.policy_opt, mode)

        # Fit linearization and store in pol_info.
        pol_info.pol_K, pol_info.pol_k, pol_info.pol_S = \
                policy_prior.fit(X, pol_mu, pol_sig)
        for t in range(T):
            pol_info.chol_pol_S[t, :, :] = \
                    sp.linalg.cholesky(pol_info.pol_S[t, :, :])
def _update_policy_fit ( self , m , init = False ) : dX , dU , T = self . dX , self . dU , self . T # Choose samples to use. samples = self . cur [ m ] . sample_list N = len ( samples ) pol_info = self . cur [ m ] . pol_info X = samples . get_X ( ) obs = samples . get_obs ( ) . copy ( ) pol_mu , pol_sig = self . policy_opt . prob ( obs ) [ : 2 ] pol_info . pol_mu , pol_info . pol_sig = pol_mu , pol_sig # Update policy prior. policy_prior = pol_info . policy_prior if init : samples = SampleList ( self . cur [ m ] . sample_list ) mode = self . _hyperparams [ 'policy_sample_mode' ] else : samples = SampleList ( [ ] ) mode = 'add' # Don't replace with empty samples policy_prior . update ( samples , self . policy_opt , mode ) # Fit linearization and store in pol_info. pol_info . pol_K , pol_info . pol_k , pol_info . pol_S = policy_prior . fit ( X , pol_mu , pol_sig ) for t in range ( T ) : pol_info . chol_pol_S [ t , : , : ] = sp . linalg . cholesky ( pol_info . pol_S [ t , : , : ] )