Skip to content

expoutinitializer

expoutinitializer

Module for expout initializer

Classes

ExpOutInitializer

ExpOutInitializer(
    git_dirs=None,
    git_modules=None,
    copy_info=None,
    environment=None,
    exp_name=None,
    exp_prefix=None,
    description=None,
    exp_type=None,
)

This class creates the first folder and files for an experiment

Source code in niceml/experiments/expoutinitializer.py
def __init__(
    self,
    git_dirs: List[str] = None,
    git_modules: List[str] = None,
    copy_info: Optional[CopyInfo] = None,
    environment: Optional[dict] = None,
    exp_name: Optional[str] = None,
    exp_prefix: Optional[str] = None,
    description: Optional[str] = None,
    exp_type: Optional[str] = None,
):
    self.copy_info = copy_info
    self.git_dirs: List[str] = git_dirs or []
    self.git_modules: List[str] = git_modules or []
    self.environment = environment or {}
    self.description = description or ""
    self.exp_name: str = exp_name or ""
    self.exp_prefix: str = exp_prefix or ""
    self.exp_type: str = exp_type or ""

Functions

produce_exp_info

produce_exp_info(
    exp_context,
    filepath,
    environment,
    description,
    short_id,
    run_id,
    exp_name,
    experiment_type="",
    exp_prefix=None,
)

This function creates the experiment info file and stores it within the experiment folder

Source code in niceml/experiments/expoutinitializer.py
def produce_exp_info(  # pylint: disable=too-many-arguments
    exp_context: ExperimentContext,
    filepath: str,
    environment: dict,
    description: str,
    short_id: str,
    run_id: str,
    exp_name: str,
    experiment_type: str = "",
    exp_prefix: Optional[str] = None,
):
    """This function creates the experiment info file
    and stores it within the experiment folder"""
    exp_info = ExperimentInfo(
        experiment_name=exp_name,
        experiment_prefix=exp_prefix,
        experiment_type=experiment_type,
        run_id=run_id,
        short_id=short_id,
        environment=environment,
        description=description,
        exp_dir=basename(dirname(filepath)),
    )
    out_dict = exp_info.as_save_dict()
    exp_context.write_yaml(out_dict, filepath)