예제 #1
0
def main():
    args = get_parser().parse_args()

    universe, domain, task = 'general', 'multigoal', 'default'
    local_dir = os.path.join(
        '~/ray_results', universe, domain, task)

    layer_size = 64
    variant_spec = {
        'seed': 1,

        'universe': universe,
        'domain': domain,
        'task': task,

        'policy': args.policy,
        'local_dir': local_dir,
        'layer_size': layer_size,
        'policy_params': {
            'type': 'GaussianPolicy',
            'kwargs': {
                'hidden_layer_sizes': (layer_size, layer_size),
            },
        },
        'Q_params': {
            'type': 'double_feedforward_Q_function',
            'kwargs': {
                'hidden_layer_sizes': (layer_size, layer_size),
            }
        },
        'run_params': {}
    }

    launch_experiments_ray([variant_spec], args, local_dir, run_experiment)
예제 #2
0
def main():
    args = get_parser().parse_args()

    universe, domain, task = parse_universe_domain_task(args)

    if ('image' in task.lower()
        or 'blind' in task.lower()
        or 'image' in domain.lower()):
        variant_spec = get_variant_spec_image(
            universe, domain, task, args.policy)
    else:
        variant_spec = get_variant_spec(universe, domain, task, args.policy)

    variant_spec['mode'] = args.mode

    if args.checkpoint_replay_pool is not None:
        variant_spec['run_params']['checkpoint_replay_pool'] = (
            args.checkpoint_replay_pool)

    local_dir_base = (
        '/scr/glebs/dev/softlearning/results'
        if args.mode in ('local', 'debug')
        else '/scr/glebs/dev/softlearning/results')
    local_dir = os.path.join(local_dir_base, universe, domain, task)
    launch_experiments_ray([variant_spec], args, local_dir, ExperimentRunner)
예제 #3
0
def get_parser():
    from examples.utils import get_parser
    parser = get_parser()

    for dest, value in (('universe', 'gym'),
                        ('task', 'MultiGoal'),
                        ('domain', 'Default-v0')):
        option = next(x for x in parser._actions if x.dest == dest)
        option.default = value
        option.choices = {value}

    return parser
예제 #4
0
def main():
    args = get_parser().parse_args()

    universe, domain, task = parse_universe_domain_task(args)

    if ('image' in task.lower() or 'blind' in task.lower()
            or 'image' in domain.lower()):
        variant_spec = get_variant_spec_image(universe, domain, task,
                                              args.policy)
    else:
        variant_spec = get_variant_spec(universe, domain, task, args.policy)

    variant_spec['mode'] = args.mode

    local_dir_base = ('~/ray_results/local'
                      if args.mode in ('local', 'debug') else '~/ray_results')
    local_dir = os.path.join(local_dir_base, universe, domain, task)
    launch_experiments_ray([variant_spec], args, local_dir, ExperimentRunner)
예제 #5
0
def get_parser():
    from examples.utils import get_parser
    parser = get_parser()
    return parser
예제 #6
0
def get_parser():
    from examples.utils import get_parser
    parser = get_parser()  # 最外层是 算法 环境 相关的设置
    #  包含了 parser = add_ray_init_args(parser)
    #  和 parser = add_ray_tune_args(parser)
    return parser