Exemplo n.º 1
0
def download_generations(run_id: str = '',
                         run_path: str = '',
                         replace: bool = False,
                         run_name=''):
    if run_name == '':
        run_name = fetch_run_name(run_id, run_path)

    for file in fetch_run(run_id, run_path).files():
        if 'generation' in file.name:
            file.download(replace=replace,
                          root=get_generations_folder_path(run_name))
Exemplo n.º 2
0
def init_generation() -> Generation:
    """either loads a saved gen from a to-be-continued run, or creates a fresh one"""
    if not os.listdir(run_man.get_generations_folder_path(config.run_name)):
        # if there are no generations in the run folder
        generation: Generation = Generation()
        Singleton.instance = generation
    else:  # continuing run
        generation: Generation = run_man.load_latest_generation(config.run_name)
        if generation is None:  # generation load failed, likely because the run did not complete gen 0
            raise Exception("generation files exist, but failed to load")

        Singleton.instance = generation
        generation.step_evolution()

    return generation
Exemplo n.º 3
0
def download_run(run_id: str = '',
                 run_path: str = '',
                 replace: bool = False) -> str:
    run_name = fetch_run_name(run_id, run_path)
    set_up_run_folder(run_name)

    for file in fetch_run(run_id, run_path).files():
        if file.name.endswith('.png'):
            continue

        if 'generation' in file.name:
            file.download(replace=replace,
                          root=get_generations_folder_path(run_name))
        elif file.name.endswith('.model'):
            file.download(replace=replace,
                          root=get_fully_train_folder_path(run_name))
        else:
            file.download(replace=replace, root=get_run_folder_path(run_name))

    return run_name