示例#1
0
    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
示例#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
示例#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
示例#4
0
def main():
    """Script entry point."""
    register_custom_components()
    cfg = parse_args(evaluation=True)
    status = enjoy(cfg)
    return status
示例#5
0
def main():
    """Script entry point."""
    cfg = parse_args(evaluation=True)
    status, avg_reward = enjoy(cfg)
    return status
示例#6
0
def main():
    """Script entry point."""
    cfg = parse_args()
    status = run_algorithm(cfg)
    return status
示例#7
0
def main():
    """Script entry point."""
    register_custom_components()
    cfg = parse_args()
    status = run_algorithm(cfg)
    return status
示例#8
0
def main():
    """Script entry point."""
    cfg = parse_args()
    return run(cfg)