Launching Experiments

Experiments in CAMPD can be launched either rapidly via a Command Line Interface (CLI) tailored for massive hyperparameter sweeps and clustering, or through your own custom python scripts.

Via Custom Python Script

For simpler execution, debugging through your IDE, or embedding CAMPD inside another project, you can bypass the launcher CLI.

import os
from campd.experiments import TrainExperiment

# Manually load custom components that aren't built-in!
import my_custom_modules.callbacks

base_dir = os.path.dirname(os.path.abspath(__file__))
yaml_path = os.path.join(base_dir, "configs/train.yaml")

# Load configuration and spin up the experiment runner
exp = TrainExperiment.from_yaml(yaml_path)
exp.run()

Warning: When strictly using from_yaml() on an Experiment class, the dependencies array within your YAML is not dynamically imported. You must assume responsibility for explicitly importing custom scripts in your python file before instantiating the classes.