[MLCAST_STACK]

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

Dataset Catalog

Standardized, high-res radar archives for ML. Access data streams via our Python interface with dask-backed xarray support.

How to Install
# Install the catalog package
pip install mlcast-datasets
How to Use
# Open and list available sources
import mlcast_datasets
cat = mlcast_datasets.open_catalog()
list(cat)
verified

Data Validator

Verify dataset compliance. Automated checks for Zarr specs, metadata integrity, and geospatial tool-chain interoperability.

How to Install
# Install the validator tool
uv tool install mlcast-dataset-validator
How to Use
# Validate a local Zarr dataset
mlcast.validate_dataset source_data \
radar_precipitation path/to/dataset.zarr
analytics

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.

How to Install
# Create venv & install
uv venv && source .venv/bin/activate
uv pip install mlcast
How to Use
# Run initial training test
mlcast train --config fiddler:use_random_sampler
layers

Model Architectures

neurology

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.

extension

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.

terminal

CLI & Configuration

Single Command

All training functionality is accessible via the mlcast train CLI. Configuration uses Google Fiddle for composable, reproducible experiments.

# Train with defaults
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
Fiddlers
  • 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
Config Consistency
  • 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
Experiment Tracking
  • assessment TensorBoard (default)
  • assessment MLflow (optional)
  • assessment W&B (optional)
  • assessment YAML config persistence + reload
speed

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

MSE

Mean Squared Error

MAE

Mean Absolute Error

CRPS

Continuous Ranked Probability Score

AFCRPS

Almost Fair CRPS

All losses support optional masking via the masked_loss parameter.

play_circle

Quick Start: Train Your First Model

Set up your environment

Create a virtual environment and install the core MLCast package along with its dependencies.

$ uv venv
$ source .venv/bin/activate
$ uv pip install mlcast
$ uv pip install mlcast-datasets
lightbulb

After training, reload any saved experiment with mlcast train --config path/to/config.yaml for full reproducibility.