Read-only mirror of https://github.com/MeteoSwiss/ai-models-ensembles — MeteoSwiss. Issues & pull requests at the source.
  • Jupyter Notebook 52.4%
  • Python 26.9%
  • nesC 10.5%
  • Shell 8.1%
  • TeX 1.6%
  • Other 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
sadamov 4e2dd76fb3 Status: revision 1 submitted
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 17:05:49 +01:00
.claude Select IC amplitude and AR(1) tau on the ablation grid 2026-11-26 09:55:50 +01:00
ai_models_ensembles Initial-condition perturbation methods and AR(1) weight noise 2026-11-25 18:39:28 +01:00
config docs: handover documentation and a generated dataset inventory 2026-11-02 12:17:17 +01:00
containers docs: handover documentation and a generated dataset inventory 2026-11-02 12:17:17 +01:00
docs Docs: revision 1 is release v1.1.0 2026-12-02 16:00:18 +01:00
env env: build the venv on uv-managed Python (--managed-python) 2026-11-03 20:22:52 +01:00
figures Table wording: configurations instead of arms 2026-11-26 11:41:51 +01:00
notebooks env: build the venv on uv-managed Python (--managed-python) 2026-11-03 20:22:52 +01:00
scripts env: build the venv on uv-managed Python (--managed-python) 2026-11-03 20:22:52 +01:00
tests phase5: per-member IFS-ENS IC source (--ic-zarr) + MARS->SwissClim rename 2026-06-08 21:36:11 +02:00
tools Table wording: configurations instead of arms 2026-11-26 11:41:51 +01:00
.gitignore handover: make the workflow survive the author's departure 2026-11-02 12:17:14 +01:00
.pre-commit-config.yaml env: pin every environment to what produced the results 2026-11-02 12:17:12 +01:00
CLAUDE.md Status: revision 1 submitted 2026-12-02 17:05:49 +01:00
LICENSE Initial commit 2023-11-23 06:34:09 -05:00
pyproject.toml notebooks: SPW quickstart (pip env, any GPU) and Clariden walkthrough 2026-11-02 20:58:58 +01:00
README.md env: build the venv on uv-managed Python (--managed-python) 2026-11-03 20:22:52 +01:00

AI Model Ensembles for Weather Forecasting

Code, pinned environments and documentation for the paper "Stochastically Perturbed Weights: Ensembles from Deterministic Machine-Learning Weather Models" (Adamov, Fuhrer, Knutti, Schemm; submitted to AMS Artificial Intelligence for the Earth Systems, preprint on arXiv physics.ao-ph).

Stochastically Perturbed Weights (SPW) turn a frozen deterministic ML weather model into an ensemble: each member gets multiplicative Gaussian noise on (a subset of) the checkpoint weights, w' = w (1 + sigma xi), with no retraining. The paper applies it to Aurora, GraphCast, SFNO and AIFS and compares the resulting ensembles with trained-probabilistic models (AIFS-ENS, Atlas, FourCastNet 3) and IFS-ENS on 112 initialisations, plus a Hurricane Milton case study.

The repository is a thin layer: earth2studio loads the models, fetches initial conditions and rolls out; SwissClim Evaluations verifies; this code adds the perturbations, the model registry, the Slurm workflow for CSCS Alps, one container per model, and the analysis behind every figure and table.

Release v1.0.0 is the code that produced the submitted results.

Documentation

Page Read it for
docs/HANDOVER.md project status, who owns what, where everything is, open items
docs/EXPERIMENTS.md method, ablation phases, production picks, metrics, settled decisions
docs/DATA.md every dataset: location, access, format, naming, provenance (inventory)
docs/REPRODUCING.md how each figure and table is made, which ones rebuild on any machine
docs/ENVIRONMENT.md dependencies and their pinned versions, checkpoints, credentials
docs/HPC.md running on CSCS Alps/Clariden, environment variables, failure modes
.claude/README.md the project notes kept for Claude Code (logbook of findings and decisions)

Layout

Path What
ai_models_ensembles/ the package: CLI, model registry, weight/IC perturbation, inference driver, SwissClim schema
scripts/ Slurm submitters for inference and verification
tools/ analysis jobs and one script per figure/table; tools/milton/ case study; tools/data/ vendored inputs
figures/ generated figures (PDF) and LaTeX tables
containers/ one Dockerfile per model, build scripts, package locks of the built images
env/ pinned host venv and conda tools
config/ example SwissClim configurations
notebooks/ end-to-end examples: a generic pip-environment quickstart and a Clariden version
docs/ documentation above
tests/ schema-bridge and CLI tests (pytest -q)

Quick start

Two notebooks run a small ensemble end to end (GraphCast with the production perturbation, 2 members, 24 h) and score it with SwissClim:

Regenerate a paper figure on any machine from the vendored data:

uv venv --managed-python --python 3.11 .venv && source .venv/bin/activate
uv pip install -r env/host-requirements.txt && uv pip install -e . --no-deps
export AIENS_STORE=$PWD/tools/data/store AIENS_SCRATCH=$PWD/tools/data/store/analysis
python tools/plot_headline_crpss_vs_lead_8way.py         # -> figures/headline_crpss_vs_lead_8way.pdf

Run inference and verification on Clariden (GH200, Slurm + pyxis/enroot):

bash containers/submit_build.sh <model|all>                          # or reuse $STORE/<model>.sqsh
bash scripts/submit_all_inference.sh aurora_encoder                  # production grid
bash scripts/evaluate_baselines.sh all aurora_encoder                # SwissClim, one job per module
python -m ai_models_ensembles.cli infer --help                       # inside a container

Forecast output follows the SwissClim schema (dims ensemble, [level,] init_time, lead_time, latitude, longitude, ECMWF long variable names, integer hPa levels); see swissclim_format.py and docs/DATA.md.

Development

pre-commit install && pre-commit run --all-files
pytest -q

Requirements: Linux or macOS for the analysis; for inference Linux aarch64 with NVIDIA GH200, CUDA 13.1 images, Slurm with pyxis/enroot, outbound HTTPS (ARCO-ERA5, Hugging Face, NGC) and a CDS key for AIFS.

License: BSD 3-Clause (LICENSE).