How it works / Overview
Overview¶
This page follows the data from the catalogue to a prediction. Each step names the code that runs it and links to the page that explains it.
The pipeline: training, evaluation and prediction share one implementation of each step.
The steps¶
Select and split.
load_training_data()keeps the stars that have a spectrum from a configured survey and a valid label from a configured label source. It splits them into training, validation and test stars (Training).Preprocess. Each spectrum becomes three channels: flux, the precision encoding ρ and a mask. Each label is scaled by the median and interquartile range of the training labels (Preprocessing).
Predict. The model maps the spectra of a star to a prediction μ and a log predicted scatter ln s for every label, one head per label source (The model).
Train. The
Trainerminimizes the negative log-likelihood of the labels and keeps the weights of the epoch with the lowest validation loss (Uncertainties, Training).Calibrate. After training, the trainer fits one calibration factor per head and parameter, so that the validation z-scores have a robust spread of 1 (Uncertainties).
Save. The checkpoint holds the weights, the configuration, the label normalization, the calibration factors and the split (Training).
Evaluate.
dorothy evaluatescores the test stars in normalized and physical units (Evaluation).Predict new stars.
dorothy predictreads spectra from a FITS file and writes each label with its uncertainty (Commands).
One definition per step¶
Training, evaluation and prediction call the same functions for each step. These cover the data selection, the preprocessing, the label normalization, the predicted scatter, its calibration and the forward pass. Evaluation on the validation stars therefore reproduces the metrics recorded during training. Shared definitions lists the functions.