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
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
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.""" register_custom_components() cfg = parse_args(evaluation=True) status = enjoy(cfg) return status
def main(): """Script entry point.""" cfg = parse_args(evaluation=True) status, avg_reward = enjoy(cfg) return status
def main(): """Script entry point.""" cfg = parse_args() status = run_algorithm(cfg) return status
def main(): """Script entry point.""" register_custom_components() cfg = parse_args() status = run_algorithm(cfg) return status
def main(): """Script entry point.""" cfg = parse_args() return run(cfg)