Пример #1
0
def main():
    parser = argparse.ArgumentParser(
        description='Experiment handler for pyagents using ALE.')
    parser.add_argument('experiment',
                        help=('The name of the experiment you want to run. '
                              'If it is NAME, there should be a file in '
                              'experiments/NAME.py that runs the actual '
                              'experiment.'),
                        default='HELP_ME_I_FORGOT_TO_GIVE_IT_AN_EXPERIMENT',
                        nargs='?')

    experiment = parser.parse_args().experiment
    if experiments.has(experiment):
        experiments.run(experiment)
Пример #2
0
def main():
    parser = argparse.ArgumentParser(
        description='Experiment handler for pyagents using ALE.')
    parser.add_argument('experiment',
                        help=('The name of the experiment you want to run. '
                              'If it is NAME, there should be a file in '
                              'experiments/NAME.py that runs the actual '
                              'experiment.'),
                        default='HELP_ME_I_FORGOT_TO_GIVE_IT_AN_EXPERIMENT',
                        nargs='?'
                        )

    experiment = parser.parse_args().experiment
    if experiments.has(experiment):
        experiments.run(experiment)
Пример #3
0
    def vertical_lines(s, x_vals):
        y1, y2 = plt.ylim()
        for x in x_vals:
            plt.plot((x,y1), (x,y2), 'k-')

    def savefig(s, filename):
        plt.tight_layout()
        fig_path = os.path.join(s.eval_path, filename)
        plt.savefig(fig_path)
        print "Saved fig in {}".format(fig_path)


if __name__ == '__main__':
    parser = argparse.ArgumentParser(
        description='Experiment evaluator for pyagents.')
    parser.add_argument('experiment',
                        help=('Name of experiment to evaluate. Automatically '
                              'uses the results of the very latest run of '
                              'the experiment.'),
                        default='HELP_ME_I_FORGOT_TO_GIVE_IT_AN_EXPERIMENT',
                        nargs='?'
                        )

    experiment = parser.parse_args().experiment
    if experiments.has(experiment):
        results_dir = experiments.get_newest_results_path(experiment)
        Evaluator(results_dir)
        # evaluate(results_dir)
else:
    raise ImportError("The evaluate_experiment module can only be run as main")
Пример #4
0
    def vertical_lines(s, x_vals):
        y1, y2 = plt.ylim()
        for x in x_vals:
            plt.plot((x, y1), (x, y2), 'k-')

    def savefig(s, filename):
        plt.tight_layout()
        fig_path = os.path.join(s.eval_path, filename)
        plt.savefig(fig_path)
        print "Saved fig in {}".format(fig_path)


if __name__ == '__main__':
    parser = argparse.ArgumentParser(
        description='Experiment evaluator for pyagents.')
    parser.add_argument('experiment',
                        help=('Name of experiment to evaluate. Automatically '
                              'uses the results of the very latest run of '
                              'the experiment.'),
                        default='HELP_ME_I_FORGOT_TO_GIVE_IT_AN_EXPERIMENT',
                        nargs='?')

    experiment = parser.parse_args().experiment
    if experiments.has(experiment):
        results_dir = experiments.get_newest_results_path(experiment)
        Evaluator(results_dir)
        # evaluate(results_dir)
else:
    raise ImportError("The evaluate_experiment module can only be run as main")