Experiment¶
The module tsl.experiment contains classes and utilities for experiment
pipelining, scalability and reproducibility. The main class in the package is
tsl.experiment.Experiment and relies on Hydra
for managing configurations.
Experiment¶
- class Experiment(run_fn: Callable, config_path: str | None = None, config_name: str | None = None, pre_run_hooks: Callable | List[Callable] = None)[source]¶
Simple class to handle the routines used to run experiments.
This class relies heavily on the Hydra framework, check Hydra docs for usage information.
- Parameters:
run_fn (callable) – Python function that actually runs the experiment when called. The run function must accept a single argument, being the experiment configuration.
config_path (str, optional) – Path to configuration files. If not specified the default will be used.
config_name (str, optional) – Name of the configuration file in
config_pathto be used. Theyamlextension can be omitted.pre_run_hooks (list) – Ordered list of functions to call on
run()before therun_fn. Every hook must accept a single argument, being the experiment configuration, and act in-place on the configuration.
- property run_dir¶
Directory of the current run, where logs and artifacts are stored.