Skip to content

Training & CLI

CLI verbs

micromamba run -n cosemu python3 -m haloemu.cli <verb> ...
# or the installed console script:
micromamba run -n cosemu haloemu <verb> ...
Verb What it does
list list every registered artifact with kind, class/deps, and accuracy
predict <prop> --gravity --redshift --theta [--out] dispatch a prediction
train <prop> --gravity --redshift [--imodels 1-64] [--iboxes 1-5] assemble → build → validate → register
validate <prop> --gravity --redshift print the manifest entry and confirm the artifact / deps load

--root overrides the artifact root (default haloemu/artifacts). --theta is a comma-separated raw θ in theta_keys order.

Training flow

train runs the plugin pipeline and registers the result:

assemble(imodels, iboxes)  →  build(bundle)  →  validate(artifact, bundle)  →  register(...)
  • Derived properties (b_diff, xi_hh) cannot be trainedtrain tells you so and exits. Build/refresh them by re-validating, since they are recipes over upstream artifacts.
  • Registration persists the pickle, writes meta.json, computes the artifact sha256, pins predict-time dependency hashes, and updates manifest.json.
micromamba run -n cosemu python3 -m haloemu.cli train hmf \
    --gravity LCDM --redshift 0.25 --imodels 1-64 --iboxes 1-5

Run heavy work on slurm

Never train on the login node

Training, validation sweeps, and any catalogue measurement go to slurm — account dp004, partition cosma8-serial. Single predictions are milliseconds and fine interactively.

Typical batch script body:

#SBATCH --account=dp004
#SBATCH --partition=cosma8-serial
export JAX_PLATFORMS=cpu
micromamba run -n cosemu python3 -m haloemu.cli train xi_mm \
    --gravity fRn1 --redshift 0.25

Chain dependent jobs with --dependency=afterok:<jobid>. The haloemu/properties/*.slurm scripts are the worked examples (measurement → train → validate → plot).

Validation & evidence harnesses

Accuracy numbers come from dedicated harnesses in haloemu/properties/, each with a matching *.slurm; all take --gravity/--redshift. The headline ones:

Harness Gate
pk_xi_validation.py pk/xi interior LOO + Hankel consistency + fiducial OOS
xi_hh_full_validation.py full-scale exact-route bands + χ + seam
fRn1_fiducial_oos.py --imodel {0,-1} sharp 100-box f(R) fiducial OOS
fRn1_xihh_signed_bands.py signed full-scale ξ_hh residual bands
ablation_sweep.py kernel × mean × n_components × n_restarts
restarts_sweep.py n_restarts sensitivity
velocity_ablation.py / vel_validation.py velocity per-moment LOO

See Accuracy & gates for what each one proves.