MLCast Software Suite
We are building a modular Python ecosystem for ML-based weather nowcasting — from data ingestion to model training and operational inference.
Dataset Catalog
Standardized, high-res radar archives for ML. Access data streams via our Python interface with dask-backed xarray support.
pip install mlcast-datasets
import mlcast_datasets
cat = mlcast_datasets.open_catalog()
list(cat)
Data Validator
Verify dataset compliance. Automated checks for Zarr specs, metadata integrity, and geospatial tool-chain interoperability.
uv tool install mlcast-dataset-validator
mlcast.validate_dataset source_data \
radar_precipitation path/to/dataset.zarr
Model Training and Inference
Streamlined Python package for building ML nowcasting models. Run training experiments using Fiddle-based configurations, with existing architectures or plug in your own.
uv venv && source .venv/bin/activate
uv pip install mlcast
mlcast train --config fiddler:use_random_sampler
Model Architectures
ConvGRU
Built-in encoder-decoder with 4 ConvGRU blocks. Encoder uses PixelUnshuffle for downsampling; decoder unrolls in latent space and materializes frames via PixelShuffle. Supports ensemble prediction with configurable ensemble size.
Custom Networks
Plug any external architecture by replacing cfg.pl_module.network with a fdl.Config node. Your model only needs a forward(x, steps, ensemble_size) method. Example integration with mfai.HalfUNet available.
CLI & Configuration
Single Command
All training functionality is accessible via the mlcast train CLI. Configuration uses Google Fiddle for composable, reproducible experiments.
mlcast train
# Override parameters inline
mlcast train --config set:data.batch_size=32 --config set:trainer.max_epochs=50
# Use a semantic fiddler
mlcast train --config fiddler:use_random_sampler --config fiddler:use_mlflow_logger
# Reload a saved experiment
mlcast train --config path/to/saved/config.yaml
- check use_random_sampler — on-the-fly random sampling
- check use_mlflow_logger — MLflow tracking
- check use_anon_s3_dataset — anonymous S3 access
- check toggle_masking — mask-aware loss
- check set_variables — input variable selection
- sync Input channels match dataset variables
- sync Width divisible by
2num_blocks - sync Ensemble models use CRPS/AFCRPS loss
- sync Mask flag synchronized with loss
- assessment TensorBoard (default)
- assessment MLflow (optional)
- assessment W&B (optional)
- assessment YAML config persistence + reload
Training Pipeline
bolt Lightning-Powered
The training loop is built on PyTorch Lightning with ModelCheckpoint, EarlyStopping (patience=100), and LearningRateMonitor. Defaults: 100 epochs, batch size 16, Adam lr=1e-4 with ReduceLROnPlateau scheduler.
grid_view Data Pipeline
Zarr-backed PyTorch datasets with CF-convention variable resolution. Supports precomputed CSV sampling and on-the-fly random sampling. Features 70/15/15 temporal splits, random augmentation (rotations + flips), and Marshall-Palmer Z-R normalization.
Loss Functions
Mean Squared Error
Mean Absolute Error
Continuous Ranked Probability Score
Almost Fair CRPS
All losses support optional masking via the masked_loss parameter.
Quick Start: Train Your First Model
Set up your environment
Create a virtual environment and install the core MLCast package along with its dependencies.
$ source .venv/bin/activate
$ uv pip install mlcast
$ uv pip install mlcast-datasets
After training, reload any saved experiment with mlcast train --config path/to/config.yaml for full reproducibility.
Ecosystem Packages
Dataset Sampler
Builds a sampling index of training-ready datacubes from catalog datasets and selects the training set. Now part of the mlcast package.
Dataset Validator
Automated compliance checks for Zarr specs, metadata integrity, and geospatial interoperability.
Benchmarks
(Coming soon) Community benchmarks for standardized evaluation of nowcasting models.
tiff2zarr
Generic GeoTIFF to mlcast-compliant Zarr v3 converter for ingesting new data sources.
Dataset Converters
Source-specific converters that turn provider radar archives into mlcast-compliant Zarr — one per dataset, growing as new sources join.
Model Training
Core package to build, train, and run ML nowcasting models with Fiddle-based configs and pluggable architectures.