torchkit.experiment
Methods useful for running experiments.
- torchkit.experiment.setup_experiment(exp_dir, config, resume=False)[source]
Initializes an experiment.
If the experiment directory doesn’t exist yet, creates it and dumps the config dict as a yaml file and git hash as a text file. If it exists already, raises a ValueError to prevent overwriting unless resume is set to True. If it exists already and resume is set to True, inplace updates the config with the values in the saved yaml file.
- Parameters
exp_dir (str) – Path to the experiment directory.
config (ConfigDict) – The config for the experiment.
resume (bool, optional) – Whether to resume from a previously created experiment. Defaults to False.
- Raises
ValueError – If the experiment directory exists already and resume is not set to True.
- Return type
None