CLI API Reference
Command-line interface entry points for training and evaluating models. These functions are called
via the openretina CLI or can be invoked programmatically with a Hydra DictConfig.
Training
train_model
train_model(cfg: DictConfig) -> float | None
Run the full training pipeline: load data, instantiate model, train, test, and optionally log to MLflow.
Returns the objective target score if configured, otherwise None.
Evaluation
evaluate_model
evaluate_model(cfg: DictConfig) -> float
Run the full evaluation pipeline: load a trained model, compute per-neuron metrics (correlation, FEVe, Poisson loss, oracle), and return the mean correlation.
evaluation.data_split may be a single split name or a list of them. Loading the stimuli,
responses and dataloaders costs far more than evaluating one split against them (~10 min vs ~5 min
for the ten qiu_2026 sessions), and none of it depends on which split is scored, so a list is
evaluated in one pass over the data rather than one process per split. Each split still gets its
own report, DataFrame and summary; with a list, model_results_path/summary_results_path are
suffixed per split so they do not overwrite each other. The returned score is that split's mean
correlation, or the mean over splits for a list.