Reference / Commands
Commands¶
This page lists every dorothy subcommand with its arguments and defaults.
pip install -e . installs the command, and dorothy <command> --help prints
the same options.
Command |
Does |
|---|---|
Trains a model from a configuration file and writes a checkpoint |
|
Scores a checkpoint on its test stars |
|
Predicts labels for the spectra in a FITS file |
|
Prints what a checkpoint holds |
dorothy --version prints the version. dorothy without a command prints
the help.
train¶
dorothy train config.yaml
Argument |
Default |
Effect |
|---|---|---|
|
required |
The YAML configuration file (Configuration) |
|
|
|
|
the configuration’s |
Directory for the experiment |
|
none |
A checkpoint directory. Its |
The command writes the checkpoint directory
<output_dir>/<name>/<name>_final/ (File formats).
--resume fails when the checkpoint has no best_model.pth, was trained
without the precision encoding, has another
multi_head_model.residual_stream value, or has weights of another shape.
evaluate¶
dorothy evaluate outputs/run/run_final
Argument |
Default |
Effect |
|---|---|---|
|
required |
The checkpoint directory |
|
|
Weights file in the checkpoint. Only |
|
|
|
|
none |
File for the results, in the |
|
|
Directory for the plots |
|
off |
Skips the plots |
|
off |
Uses the raw predicted scatter, without the calibration factors |
|
|
|
|
|
Spectra per forward pass |
The command evaluates the test stars of data_split.pkl. Without that file,
it recreates the split from the configured seed. It scores every output
head, in normalized and physical units (Evaluation).
Output |
Content |
|---|---|
Screen |
The metrics of each head; with calibration factors, a table of the factors and the raw and calibrated |
|
The first head’s metrics at the top level and every head’s under |
Plots |
Four per label source: |
predict¶
dorothy predict --checkpoint outputs/run/run_final --input spectra.fits \
--survey boss --label-source apogee
Argument |
Default |
Effect |
|---|---|---|
|
required |
The checkpoint directory |
|
required |
The FITS file of spectra (FITS input) |
|
|
The CSV file to write (Predictions CSV) |
|
none |
Survey of the spectra. Required for a model with several surveys |
|
the first label source |
Output head to predict from |
|
off |
Writes normalized units instead of physical units |
|
off |
Writes the raw predicted scatter, without the calibration factors |
|
|
|
|
|
Spectra per forward pass |
The spectra get the preprocessing of the checkpoint’s configuration (Preprocessing). The command fails when the spectra have another number of wavelength bins than the model’s survey.
info¶
dorothy info outputs/run/run_final
Argument |
Default |
Effect |
|---|---|---|
|
required |
The checkpoint directory |
The command prints these parts of the checkpoint.
Part |
Content |
|---|---|
Model files |
Each |
Configuration |
Architecture, uncertainty model ( |
Training history |
Epochs, final training loss, best validation loss and epoch, per label source |
Normalizer |
The normalized parameters |
Calibration |
The factor per parameter and head, or |
Learning rates |
Number of optimizer steps and the range |
Exit codes¶
Code |
Meaning |
|---|---|
0 |
Success, |
1 |
An error that the command reports as |
2 |
Invalid arguments |
dorothy info exits with 1 only when the checkpoint directory does not
exist. For a file that it cannot read, it prints an Error loading … line,
goes on and exits with 0.