Neural-LAM#
Graph-native neural weather prediction for Limited Area Modeling. Powered by PyTorch, PyTorch Lightning, and PyG.
Neural-LAM brings graph learning to kilometer-scale regional weather prediction. The toolkit focuses on Limited Area Modeling workloads, providing strong defaults for constrained domains while staying easily extensible for new sensors, datastores, and architectures.
Built for research velocity — curated tutorials, minimal boilerplate, and batteries-included configs for common experiments.
Tuned for operational realism — explicit boundary handling, datastore validation, and reproducible preprocessing pipelines.
Rooted in open science — exhaustive API docs and transparent training recipes.
Quick install
pip install neural_lam
Paper Reference
For the scientific background behind the models implemented here, see “Building Machine Learning Limited Area Models: Kilometer-Scale Weather Forecasting in Realistic Settings” (Adamov et al., 2025) — arXiv:2504.09340
Getting Started#
Goal |
Resource |
|---|---|
Spin up the workflow end-to-end |
|
Visualise the graph instantly in Colab |
|
Understand the canonical datastore |
|
Integrate a custom dataset |
|
Dive into every module |
Each tutorial layers on the previous one: Hello World produces the zarr datastore that Datastore Explorer inspects, and the datastore deep dive underpins Adding a New Datastore.
Tutorials#
Hello World: Training on DANRA#
Fastest route from install to a trained checkpoint:
Bootstrap the environment with
uvand fetch a public DANRA subset viamllam-data-prep— no local mirror required.Generate the single-level
1levelgraph, prepare features, and train agraph_lambaseline for one CPU epoch.Inspect metrics and checkpoints to validate the full pipeline.
Ideal for smoke-testing your setup before scaling up or adding GPUs.
Datastore Explorer#
Build intuition for the zarr datastore format that underpins neural-lam:
Decode the flattened
grid_indexback to true 2D geometry for any non-square domain.Review canonical dimensions, coordinates, time splits, and normalisation statistics.
Visualize every state, forcing, and static feature with production-ready routines.
Spend time here before adapting a new dataset; it prevents downstream errors.
Adding a New Datastore#
A rigorous playbook for onboarding external data:
Walk through the
BaseDatastorecontract and the config-drivenMDPDatastorepath.Extend the
BaseRegularGridDatastoretemplate for bespoke projections or irregular formats.Avoid common pitfalls: naming conventions, projections, boundary masks, and standardisation variables.
Validate implementations with
validate_datastore()before training.
Required reading for contributors integrating novel data sources.
Creating meps_example_reduced#
Documented recipe for the bundled MEPS sample dataset. Follow the same coordinate subsetting, time-window selection, and export steps when preparing reduced regional datasets for development or CI workflows.
API Reference#
Explore the full API — every public class, method, function, and module is rendered with NumPy-style docstrings and cross links.
neural_lam.models— GraphLAM, HiLAM, HiLAMParallelneural_lam.datastore— BaseDatastore, MDPDatastore, NpyFilesDatastoreMEPSneural_lam.config— configuration loading and validationneural_lam.metrics— WMSE, MAE, and metric utilities