(self, itr_load=None)
Run training by iteratively sampling and taking an iteration.
        Args:
            itr_load: If specified, loads algorithm state from that
                iteration, and resumes training at the next iteration.
        Returns: None
Run training by iteratively sampling and taking an iteration.
        Args:
            itr_load: If specified, loads algorithm state from that
                iteration, and resumes training at the next iteration.
        Returns: None
Run training by iteratively sampling and taking an iteration . Args : itr_load : If specified loads algorithm state from that iteration and resumes training at the next iteration . Returns : None
def run(self, itr_load=None):
        """
        Run training by iteratively sampling and taking an iteration.
        Args:
            itr_load: If specified, loads algorithm state from that
                iteration, and resumes training at the next iteration.
        Returns: None
        """
        try:
            itr_start = self._initialize(itr_load)

            for itr in range(itr_start, self._hyperparams['iterations']):
                for cond in self._train_idx:
                    for i in range(self._hyperparams['num_samples']):
                        self._take_sample(itr, cond, i)

                traj_sample_lists = [
                    self.agent.get_samples(cond, -self._hyperparams['num_samples'])
                    for cond in self._train_idx
                ]

                # Clear agent samples.
                self.agent.clear_samples()

                self._take_iteration(itr, traj_sample_lists)
                pol_sample_lists = self._take_policy_samples()
                self._log_data(itr, traj_sample_lists, pol_sample_lists)
        except Exception as e:
            traceback.print_exception(*sys.exc_info())
        finally:
            self._end()
def run ( self , itr_load = None ) : try : itr_start = self . _initialize ( itr_load ) for itr in range ( itr_start , self . _hyperparams [ 'iterations' ] ) : for cond in self . _train_idx : for i in range ( self . _hyperparams [ 'num_samples' ] ) : self . _take_sample ( itr , cond , i ) traj_sample_lists = [ self . agent . get_samples ( cond , - self . _hyperparams [ 'num_samples' ] ) for cond in self . _train_idx ] # Clear agent samples. self . agent . clear_samples ( ) self . _take_iteration ( itr , traj_sample_lists ) pol_sample_lists = self . _take_policy_samples ( ) self . _log_data ( itr , traj_sample_lists , pol_sample_lists ) except Exception as e : traceback . print_exception ( * sys . exc_info ( ) ) finally : self . _end ( )