Skip to content

Configuration (YAML)

One YAML drives the whole pipeline. Model sections define the cosmology; the optional samples, train, evaluate, run and cluster sections drive each stage. Unknown keys in the samples, train, evaluate, run and cluster sections are rejected up front, before CLASS runs.

theory:
  classy:
    # path: /path/to/CLASS          # optional, see "Custom CLASS builds"
    extra_args:
      output: "tCl,pCl,lCl"
      l_max_scalars: 2500

observables: [TT, TE, EE]

parameters:
  h: [0.64, 0.72]                   # [min, max]
  omega_b: [0.021, 0.023]
  omega_cdm: [0.11, 0.13]

samples:
  designs:
    train: {method: sobol, N: 128, seed: 0}
    test:  {method: lhc,   N: 64,  seed: 1}

train:
  test_design: test
  backend: jax
  defaults: {n_pca: 12}
  out: bundles/model.cemu

evaluate:
  ell_ranges: [2, 30, 500, 2500]

Override any value from the command line with a dotted path:

class-e train cfg.yaml --set train.defaults.n_pca=16
class-e generate cfg.yaml --set theory.classy.extra_args.l_max_scalars=3000

Sections

Section Purpose
theory CLASS build and extra_args passed to CLASS
parameters sampled parameters and their prior box
derived quantities computed from parameters
observables stored observables: TT, TE, EE, PP, mPk, Tk
samples number of points, method (sobol, lhc, lhs, cov), seed, constraints, named designs
train design or dataset to train on, backend, defaults, per-observable settings, inputs, out
evaluate by bins, ell_ranges, worst, plots
run workers, threads_per_point, chunk_size, checkpoint_every, retries, isolate
cluster SLURM job options, see Cluster

Parameters

Two forms are accepted:

parameters:
  h: [0.6, 0.8]                     # simple bounds
  omega_b:                          # full form
    min: 0.020
    max: 0.025
    latex: \omega_b                 # label for plots
    alias: omega_c                  # name passed to CLASS
    drop: false                     # true: sampled but not sent to CLASS

omega_cdm and omega_c are aliases of each other.

Derived parameters

Derived parameters are computed on the fly from expressions of the sampled parameters. They are not sent to CLASS.

parameters:
  h: [0.6, 0.8]

derived:
  H0:
    expression: "h * 100"
    latex: H_0 \, [\rm km/s/Mpc]

Extended cosmologies

Extra CLASS parameters are ordinary entries of parameters:

parameters:
  w0_fld: {min: -1.5, max: -0.5, default: -1.0, latex: w_0}
  wa_fld: {min: -1.0, max:  1.0, default:  0.0, latex: w_a}

Ready-made models live in configs/ (lcdm, w0wacdm, lcdm-mnu, ede-axiclass, toy-pipeline, ...). For the Python API of the model factory see Cosmology model.