Ejemplo n.º 1
0
def load(run_uuid: str, checkpoint: Optional[int] = None):
    r"""
    Loads and starts the experiment from a previous checkpoint.

    Keyword Arguments:
        run_uuid (str): if provided the experiment will start from
            a saved state in the run with UUID ``run_uuid``
        checkpoint (str, optional): if provided the experiment will start from
            given checkpoint. Otherwise it will start from the last checkpoint.
    """
    _experiment_singleton().start(run_uuid=run_uuid, checkpoint=checkpoint)
Ejemplo n.º 2
0
def calculate_configs(configs: Optional[BaseConfigs],
                      configs_dict: Optional[Dict[str, any]] = None,
                      run_order: Optional[List[Union[List[str], str]]] = None):
    r"""
    Calculate configurations

    Arguments:
        configs (Configs, optional): configurations object
        configs_dict (Dict[str, any], optional): a dictionary of
            configs to be overridden
        run_order (List[Union[str, List[str]]], optional): list of
            configs to be calculated and the order in which they should be
            calculated. If ``None`` all configs will be calculated.
    """
    if configs_dict is None:
        configs_dict = {}

    _experiment_singleton().calc_configs(configs, configs_dict, run_order)
Ejemplo n.º 3
0
def save_numpy(name: str, array: np.ndarray):
    r"""
    Saves a single numpy array. This is used to save processed data.
    """
    numpy_path = Path(_experiment_singleton().run.numpy_path)

    if not numpy_path.exists():
        numpy_path.mkdir(parents=True)
    file_name = name + ".npy"
    np.save(str(numpy_path / file_name), array)
Ejemplo n.º 4
0
def save_checkpoint():
    _experiment_singleton().save_checkpoint()
Ejemplo n.º 5
0
def start():
    r"""
    Starts the experiment.
    """
    _experiment_singleton().start()