def main(ctx, **args):
    """Launch IBExplorationAgent."""
    if not osp.exists(args["local_dir"]) and click.confirm(
            "Provided `local_dir` does not exist. Create it?"):
        os.makedirs(args["local_dir"])
        click.echo("Created directory {}".format(args["local_dir"]))

    exp_dir = osp.join(args["local_dir"], args["name"])
    if osp.exists(exp_dir) and not click.confirm(
            f"Experiment directory {exp_dir} already exists. Proceed anyway?"):
        ctx.exit()

    raylab.register_all_environments()
    raylab.register_all_agents()
    ray.init()
    logging.getLogger("ray.tune").setLevel(args["tune_log_level"])
    tune.run(
        IBExplorationAgent,
        name=args["name"],
        local_dir=args["local_dir"],
        num_samples=args["num_samples"],
        stop={k: v
              for k, v in args["stop"]},
        config=CONFIG,
        checkpoint_freq=args["checkpoint_freq"],
        checkpoint_at_end=args["checkpoint_at_end"],
        loggers=CUSTOM_LOGGERS if args["custom_loggers"] else None,
    )
Beispiel #2
0
    def wrapped(*args, **kwargs):
        import raylab

        raylab.register_all_agents()
        raylab.register_all_environments()

        return func(*args, **kwargs)
Beispiel #3
0
def main():
    raylab.register_all_agents()
    raylab.register_all_environments()
    with suppress(KeyboardInterrupt):
        parser = create_parser()
        args = parser.parse_args()
        run(args, parser)
Beispiel #4
0
def register_agents():
    import raylab

    raylab.register_all_agents()
Beispiel #5
0
def setup():
    ray.init(ignore_reinit_error=True)
    raylab.register_all_agents()
    raylab.register_all_environments()
Beispiel #6
0
def main():
    raylab.register_all_agents()
    raylab.register_all_environments()
    parser = create_parser()
    args = parser.parse_args()
    run(args, parser)