def __init__(self, name, args):
        self.name = name
        self.args = args
        self.policy_index = None
        self.parsed_config = parse_args(args, evaluation=True)
        self.cfg = load_from_checkpoint(self.parsed_config)

        self.actor_critic = None
        self.rnn_state = None
Exemple #2
0
def custom_parse_args(argv=None, evaluation=False):
    """
    Parse default SampleFactory arguments and add user-defined arguments on top.
    Setting the evaluation flag to True adds additional CLI arguments for evaluating the policy (see the enjoy_ scripts)

    """
    parser = arg_parser(argv, evaluation=evaluation)

    # insert additional parameters here if needed

    cfg = parse_args(argv=argv, evaluation=evaluation, parser=parser)
    return cfg
Exemple #3
0
def custom_parse_args(argv=None, evaluation=False):
    """
    Parse default SampleFactory arguments and add user-defined arguments on top.
    Allow to override argv for unit tests. Default value (None) means use sys.argv.
    Setting the evaluation flag to True adds additional CLI arguments for evaluating the policy (see the enjoy_ script).

    """
    parser = arg_parser(argv, evaluation=evaluation)

    # add custom args here
    parser.add_argument('--my_custom_arg', type=int, default=42, help='Any custom arguments users might define')

    # SampleFactory parse_args function does some additional processing (see comments there)
    cfg = parse_args(argv=argv, evaluation=evaluation, parser=parser)
    return cfg
def main():
    """Script entry point."""
    cfg = parse_args(evaluation=True)
    status, avg_reward = enjoy(cfg)
    return status
def parse_args_curious_ppo(params_cls):
    return parse_args(DEFAULT_ENV, DEFAULT_EXPERIMENT_NAME, params_cls)
def main():
    """Script entry point."""
    cfg = parse_args()
    return run(cfg)
Exemple #7
0
def main():
    """Script entry point."""
    cfg = parse_args()
    status = run_algorithm(cfg)
    return status
def parse_args_random(params_cls):
    return parse_args(DEFAULT_ENV, DEFAULT_EXPERIMENT_NAME, params_cls)
def parse_args_tmax(params_cls, argv=None):
    return parse_args(DEFAULT_ENV,
                      DEFAULT_EXPERIMENT_NAME,
                      params_cls,
                      argv=argv)