(self)
Instantiate dynamics objects and update prior. Fit dynamics to
        current samples.
Instantiate dynamics objects and update prior. Fit dynamics to
        current samples.
Instantiate dynamics objects and update prior . Fit dynamics to current samples .
def _update_dynamics(self):
        """
        Instantiate dynamics objects and update prior. Fit dynamics to
        current samples.
        """
        for m in range(self.M):
            cur_data = self.cur[m].sample_list
            X = cur_data.get_X()
            U = cur_data.get_U()

            # Update prior and fit dynamics.
            self.cur[m].traj_info.dynamics.update_prior(cur_data)
            self.cur[m].traj_info.dynamics.fit(X, U)

            # Fit x0mu/x0sigma.
            x0 = X[:, 0, :]
            x0mu = np.mean(x0, axis=0)
            self.cur[m].traj_info.x0mu = x0mu
            self.cur[m].traj_info.x0sigma = np.diag(
                np.maximum(np.var(x0, axis=0),
                           self._hyperparams['initial_state_var'])
            )

            prior = self.cur[m].traj_info.dynamics.get_prior()
            if prior:
                mu0, Phi, priorm, n0 = prior.initial_state()
                N = len(cur_data)
                self.cur[m].traj_info.x0sigma += \
                        Phi + (N*priorm) / (N+priorm) * \
                        np.outer(x0mu-mu0, x0mu-mu0) / (N+n0)
def _update_dynamics ( self ) : for m in range ( self . M ) : cur_data = self . cur [ m ] . sample_list X = cur_data . get_X ( ) U = cur_data . get_U ( ) # Update prior and fit dynamics. self . cur [ m ] . traj_info . dynamics . update_prior ( cur_data ) self . cur [ m ] . traj_info . dynamics . fit ( X , U ) # Fit x0mu/x0sigma. x0 = X [ : , 0 , : ] x0mu = np . mean ( x0 , axis = 0 ) self . cur [ m ] . traj_info . x0mu = x0mu self . cur [ m ] . traj_info . x0sigma = np . diag ( np . maximum ( np . var ( x0 , axis = 0 ) , self . _hyperparams [ 'initial_state_var' ] ) ) prior = self . cur [ m ] . traj_info . dynamics . get_prior ( ) if prior : mu0 , Phi , priorm , n0 = prior . initial_state ( ) N = len ( cur_data ) self . cur [ m ] . traj_info . x0sigma += Phi + ( N * priorm ) / ( N + priorm ) * np . outer ( x0mu - mu0 , x0mu - mu0 ) / ( N + n0 )