Experiment

labml.experiment.create(*, name: Optional[str] = None, python_file: Optional[str] = None, comment: Optional[str] = None, writers: Set[str] = None, ignore_callers: Set[str] = None, tags: Optional[Set[str]] = None)[source]

Create an experiment

Keyword Arguments
  • name (str, optional) – name of the experiment

  • python_file (str, optional) – path of the Python file that created the experiment

  • comment (str, optional) – a short description of the experiment

  • writers (Set[str], optional) – list of writers to write stat to. Defaults to {'tensorboard', 'sqlite'}.

  • ignore_callers – (Set[str], optional): list of files to ignore when automatically determining python_file

  • tags (Set[str], optional) – Set of tags for experiment

labml.experiment.get_uuid()[source]

Returns the UUID of the current experiment run

labml.experiment.add_pytorch_models(models: Dict[str, torch.nn.Module])[source]

Set variables for saving and loading

Parameters

models (Dict[str, torch.nn.Module]) – a dictionary of torch modules used in the experiment. These will be saved with labml.experiment.save_checkpoint() and loaded with labml.experiment.load().

labml.experiment.add_sklearn_models(models: Dict[str, any])[source]

Warning

This is still experimental.

Set variables for saving and loading

Parameters

models (Dict[str, any]) – a dictionary of SKLearn models These will be saved with labml.experiment.save_checkpoint() and loaded with labml.experiment.load().

labml.experiment.configs(*args)[source]

Calculate configurations

This has multiple overloads

labml.experiment.configs(configs_dict: Dict[str, any])[source]
labml.experiment.configs(configs_dict: Dict[str, any], configs_override: Dict[str, any])[source]
labml.experiment.configs(configs: BaseConfigs)[source]
labml.experiment.configs(configs: BaseConfigs, run_order: List[Union[List[str], str]])[source]
labml.experiment.configs(configs: BaseConfigs, *run_order: str)[source]
labml.experiment.configs(configs: BaseConfigs, configs_override: Dict[str, any])[source]
labml.experiment.configs(configs: BaseConfigs, configs_override: Dict[str, any], run_order: List[Union[List[str], str]])[source]
labml.experiment.configs(configs: BaseConfigs, configs_override: Dict[str, any], *run_order: str)[source]
Parameters
  • configs (BaseConfigs, optional) – configurations object

  • configs_dict (Dict[str, any], optional) – a dictionary of configs

  • configs_override (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 not provided all configs will be calculated.

labml.experiment.start()[source]

Starts the experiment.

labml.experiment.load(run_uuid: str, checkpoint: Optional[int] = None)[source]

Loads and starts the run from a previous checkpoint.

Parameters
  • run_uuid (str) – 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.

labml.experiment.save_checkpoint()[source]

Saves model checkpoints

labml.experiment.save_numpy(name: str, array: numpy.ndarray)[source]

Saves a single numpy array. This is used to save processed data.