Prerequisites#
Before using Malet, you need two things: an experiment folder and a training function.
Experiment folder#
Create a folder for each experiment containing a YAML config file. Malet generates log files and figures in the same folder automatically:
experiments/
└── my_experiment/
├── exp_config.yaml (you create this)
├── log.tsv (generated by malet.experiment)
├── log_splits/ (generated when using parallel splits)
└── figure/ (generated by malet-plot)
Organizing all experiments under a shared experiments/ directory keeps configs, logs, and plots together and makes CLI plotting straightforward.
Training function#
Your training function accepts a configuration object and returns a dictionary of metrics. Each metric value must be a list — one entry per epoch or step. This is what lets Malet plot training curves, select best-performing steps, and compute statistics across seeds.
def train(config, ...):
# ... training logic ...
return {
'train_accuracies': train_accuracies, # list[float], one per epoch
'val_accuracies': val_accuracies,
'train_losses': train_losses,
'val_losses': val_losses,
}