(self, itr, N)
Take N policy samples of the algorithm state at iteration itr,
        for testing the policy to see how it is behaving.
        (Called directly from the command line --policy flag).
        Args:
            itr: the iteration from which to take policy samples
            N: the number of policy samples to take
        Returns: None
Take N policy samples of the algorithm state at iteration itr,
        for testing the policy to see how it is behaving.
        (Called directly from the command line --policy flag).
        Args:
            itr: the iteration from which to take policy samples
            N: the number of policy samples to take
        Returns: None
Take N policy samples of the algorithm state at iteration itr for testing the policy to see how it is behaving . ( Called directly from the command line -- policy flag ) . Args : itr : the iteration from which to take policy samples N : the number of policy samples to take Returns : None
def test_policy(self, itr, N):
        """
        Take N policy samples of the algorithm state at iteration itr,
        for testing the policy to see how it is behaving.
        (Called directly from the command line --policy flag).
        Args:
            itr: the iteration from which to take policy samples
            N: the number of policy samples to take
        Returns: None
        """
        algorithm_file = self._data_files_dir + 'algorithm_itr_%02d.pkl' % itr
        self.algorithm = self.data_logger.unpickle(algorithm_file)
        if self.algorithm is None:
            print("Error: cannot find '%s.'" % algorithm_file)
            os._exit(1) # called instead of sys.exit(), since t
        traj_sample_lists = self.data_logger.unpickle(self._data_files_dir +
            ('traj_sample_itr_%02d.pkl' % itr))

        pol_sample_lists = self._take_policy_samples(N)
        self.data_logger.pickle(
            self._data_files_dir + ('pol_sample_itr_%02d.pkl' % itr),
            copy.copy(pol_sample_lists)
        )

        if self.gui:
            self.gui.update(itr, self.algorithm, self.agent,
                traj_sample_lists, pol_sample_lists)
            self.gui.set_status_text(('Took %d policy sample(s) from ' +
                'algorithm state at iteration %d.\n' +
                'Saved to: data_files/pol_sample_itr_%02d.pkl.\n') % (N, itr, itr))
def test_policy ( self , itr , N ) : algorithm_file = self . _data_files_dir + 'algorithm_itr_%02d.pkl' % itr self . algorithm = self . data_logger . unpickle ( algorithm_file ) if self . algorithm is None : print ( "Error: cannot find '%s.'" % algorithm_file ) os . _exit ( 1 ) # called instead of sys.exit(), since t traj_sample_lists = self . data_logger . unpickle ( self . _data_files_dir + ( 'traj_sample_itr_%02d.pkl' % itr ) ) pol_sample_lists = self . _take_policy_samples ( N ) self . data_logger . pickle ( self . _data_files_dir + ( 'pol_sample_itr_%02d.pkl' % itr ) , copy . copy ( pol_sample_lists ) ) if self . gui : self . gui . update ( itr , self . algorithm , self . agent , traj_sample_lists , pol_sample_lists ) self . gui . set_status_text ( ( 'Took %d policy sample(s) from ' + 'algorithm state at iteration %d.\n' + 'Saved to: data_files/pol_sample_itr_%02d.pkl.\n' ) % ( N , itr , itr ) )