Esempio n. 1
0
def run_sql_experiment(main,
                       mode,
                       include_folders=None,
                       log_dir=None,
                       exp_prefix="experiment",
                       exp_name=None,
                       **kwargs):
    if exp_name is None:
        exp_name = timestamp()

    if log_dir is None:
        log_dir = os.path.join(DEFAULT_LOG_DIR, "local",
                               exp_prefix.replace("_", "-"), exp_name)

    if include_folders is None:
        include_folders = list()

    if mode == 'ec2':
        include_folders.append('softqlearning')
        all_symlinks = list()

        for folder in include_folders:
            all_symlinks.append(_create_symlink(folder))

        kwargs.update(added_project_directories=all_symlinks)

    run_experiment(
        method_call=main,
        mode=mode,
        exp_prefix=exp_prefix,
        exp_name=exp_name,
        log_dir=log_dir,
        **kwargs)
Esempio n. 2
0
def main():
    full_experiment_name = 'sawyer'
    full_experiment_name += '-' + timestamp()
    args = parse_args()
    saved_file = args.file
    run_sql_experiment(run_experiment,
                       mode='local',
                       variant=dict(file=saved_file),
                       exp_prefix='sawyer' + '/' + 'reuse' + '/' + timestamp(),
                       exp_name=full_experiment_name,
                       n_parallel=1,
                       seed=1,
                       terminate_machine=True,
                       log_dir=None,
                       snapshot_mode='gap',
                       snapshot_gap=100,
                       sync_s3_pkl=True)
    return
def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--env', type=str, choices=AVAILABLE_ENVS, default=DEFAULT_ENV)
    parser.add_argument('--exp_name', type=str, default=timestamp())
    parser.add_argument('--mode', type=str, default='local')
    parser.add_argument('--log_dir', type=str, default=None)
    args = parser.parse_args()

    return args
def main():
    full_experiment_name = 'swimmer'
    full_experiment_name += '-' + timestamp()
    args = parse_args()
    saved_file = args.file
    run_sql_experiment(
        run_experiment,
        mode='local',
        variant=dict(file=saved_file),
        exp_prefix='swimmer' + '/' + 'reuse' + '/' + timestamp(),
        exp_name=full_experiment_name,
        n_parallel=1,
        seed=1,
        terminate_machine=True,
        log_dir=None,
        snapshot_mode='gap',
        snapshot_gap=100,
        sync_s3_pkl=True)
    return
def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--env', type=str, choices=AVAILABLE_ENVS, default=DEFAULT_ENV)
    parser.add_argument('--exp_name', type=str, default=timestamp())
    parser.add_argument('--mode', type=str, default='local')
    parser.add_argument('--log_dir', type=str, default=None)
    args = parser.parse_args()

    return args