PPNN
Model Introduction
PPNN converts ensemble weather forecasts and station information into calibrated probability distributions for 2 m temperature, supporting station-level ensemble postprocessing, uncertainty representation, and probabilistic weather forecasting.
Paper: Neural Networks for Postprocessing Ensemble Weather Forecasts
https://doi.org/10.1175/MWR-D-18-0187.1
Model Description
The method was proposed by research teams at Ludwig-Maximilians-Universität München, Karlsruhe Institute of Technology, and the Heidelberg Institute for Theoretical Studies. The paper trains on ECMWF TIGGE ensemble forecasts and Deutscher Wetterdienst station observations of 2 m temperature. It is intended for station-temperature probabilistic postprocessing and ensemble calibration at a fixed 48-hour lead.
Use Cases
| Use Case | Description |
|---|---|
| Ensemble forecast postprocessing | Generate Gaussian temperature forecasts from ensemble moments and station information. |
| Probabilistic training | Train mean and scale parameters with Gaussian CRPS. |
| ModelScope/OneCode execution | Validate feature construction, training, inference, calibration evaluation, and visualization in ModelScope or OneCode environments. |
| Multi-GPU training | Train independent network replicas through torchrun. |
Usage Instructions
1.OneCode
Experience intelligent, one-click AI4S programming through the OneCode online environment:
Try intelligent, one-click AI4S programming
2. Download and Installation
hf download OneScience-Group/PPNN --local-dir ./PPNN
cd PPNN
Environment Dependencies
Hardware Requirements
- A GPU or DCU is recommended.
- A CPU can be used for connectivity validation with the default small-sample configuration.
- DCU users must install DTK first. DTK 25.04.2 or later, or the OneScience-recommended version matching the cluster, is recommended.
DCU Environment
# Activate DTK and Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
GPU Environment
# Activate Conda first
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
Training Data
Training data consist of ECMWF TIGGE ensemble forecasts and DWD station observations of 2 m temperature. Each sample contains 50 ensemble members, 18 forecast variables, and station location and elevation information, with same-valid-time station temperature as the target. Forecasts are initialized daily at 00 UTC with a fixed 48-hour lead, and temperature is measured in degrees Celsius. This repository uses a small number of synthetic samples to validate training, inference, and probabilistic evaluation; they do not represent the official TIGGE or DWD distribution, training scale, or formal paper performance.
python scripts/fake_data.py
Training
For single-device training, use:
python scripts/train.py
For multi-GPU training, use:
torchrun --nproc_per_node=8 --nnodes=1 --rdzv_id=1000 --rdzv_backend=c10d --max_restarts=0 --master_addr="localhost" --master_port=29500 scripts/train.py
The default engineering configuration reduces the hidden width from the paper's long-training value of 512 to 32, the independent network count from 10 to 2, and the training epochs and sample count. It does not reduce the 50 members, 18 variables, metadata for 537 stations, two-dimensional station embedding, or 48-hour lead. A formal experiment requires the real TIGGE and DWD data, the paper-scale network ensemble, and the complete training period.
Training outputs are saved to:
result/checkpoints/ppnn.pt
result/training/metrics.json
Trained Weights
No weights are bundled under weight/, and no directly loadable pretrained checkpoint released by the paper authors was identified. Locally trained engineering checkpoints are written to result/checkpoints/ppnn.pt and must not be represented as official pretrained weights.
Inference
python scripts/inference.py
Inference loads the trained checkpoint and generates Gaussian temperature forecasts at the fixed 48-hour lead from 50-member ensemble statistics and station information. Complete numerical results are saved to:
result/output/predictions.npz
Evaluation and Visualization
python scripts/result.py
Evaluation follows the paper's probabilistic protocol for Gaussian CRPS, raw-ensemble CRPS, CRPSS, PIT calibration, and spread-error diagnostics, saving overall and station-sample aggregate results; the task has one fixed 48-hour lead and no classes, so no per-lead or per-class metrics are saved. It also generates PIT-calibration and probabilistic-error comparisons. Synthetic-data results validate the engineering workflow only and do not represent formal paper performance.
result/evaluation/metrics.json
result/evaluation/ppnn_evaluation.png
Official OneScience Information
| Platform | OneScience Main Repository | Skills Repository |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
Citation and License
This repository is an independent engineering reproduction of the public PPNN specifications.
Use of this repository's code, official model weights, and data remains subject to the licenses and terms of their respective projects.
中文说明
模型简介
PPNN 将集合天气预报(ensemble forecast)和站点信息转换为 2 m 气温的校准概率分布,支持站点级集合后处理、不确定性表征和概率天气预报(weather forecasting)。
论文:用于集合天气预报后处理的神经网络
https://doi.org/10.1175/MWR-D-18-0187.1
模型描述
该方法由慕尼黑大学、卡尔斯鲁厄理工学院及海德堡理论研究所的团队提出。论文使用 ECMWF TIGGE 集合预报及德国气象局的站点 2 m 气温观测训练。其用途是固定 48-hour 预报时效下的站点气温概率后处理和集合校准。
使用场景
| 使用场景 | 说明 |
|---|---|
| 集合预报后处理 | 根据集合矩和站点信息生成高斯气温预报。 |
| 概率训练 | 使用高斯 CRPS 训练均值和尺度参数。 |
| ModelScope/OneCode 运行 | 在 ModelScope 或 OneCode 环境中验证特征构建、训练、推理(inference)、校准评估和可视化。 |
| 多 GPU 训练 | 通过 torchrun 训练独立的网络副本。 |
使用指南
1.OneCode
通过 OneCode 在线环境体验智能一键 AI4S 编程。
2. 下载与安装
hf download OneScience-Group/PPNN --local-dir ./PPNN
cd PPNN
环境依赖
硬件要求
- 建议使用 GPU 或 DCU。
- 可使用 CPU 在默认小样本配置下进行连通性验证。
- DCU 用户须先安装 DTK。建议使用 DTK 25.04.2 或更高版本,或使用 OneScience 推荐的与集群匹配的版本。
DCU 环境
# Activate DTK and Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
GPU 环境
# Activate Conda first
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
训练数据
训练数据由 ECMWF TIGGE 集合预报和 DWD 站点 2 m 气温观测组成。每个样本包含 50 个集合成员、18 个预报变量,以及站点位置和海拔信息,目标为相同有效时刻的站点气温。预报每日 00 UTC 初始化,固定预报时效为 48-hour,气温以 degrees Celsius 为单位。本仓库使用少量合成样本验证训练、推理和概率评估。样本无法代表官方 TIGGE 或 DWD 的分布、训练规模或论文正式性能。
python scripts/fake_data.py
训练
单设备训练
python scripts/train.py
多 GPU 训练
torchrun --nproc_per_node=8 --nnodes=1 --rdzv_id=1000 --rdzv_backend=c10d --max_restarts=0 --master_addr="localhost" --master_port=29500 scripts/train.py
默认工程配置将隐藏层宽度从论文长训练方案所用的 512 缩减到 32,将独立网络数从 10 减至 2,并减少训练轮数和样本数量。它保留 50 个成员、18 个变量、537 个站点的元数据、二维站点嵌入及 48-hour 预报时效。正式实验需要真实的 TIGGE 和 DWD 数据、论文规模的网络集合及完整训练期。
训练输出保存到以下位置。
result/checkpoints/ppnn.pt
result/training/metrics.json
训练权重
weight/ 下未附带权重,且未找到论文作者发布的可直接加载的预训练模型权重(检查点)(checkpoint)。本地训练得到的工程模型权重(检查点)写入 result/checkpoints/ppnn.pt,不得将其视为官方预训练权重。
推理
python scripts/inference.py
推理加载训练得到的模型权重(检查点),根据 50 个成员的集合统计量及站点信息生成固定 48-hour 时效的高斯气温预报。完整数值结果保存到以下位置。
result/output/predictions.npz
评估与可视化
python scripts/result.py
评估遵循论文的概率规程,计算高斯 CRPS、原始集合 CRPS、CRPSS、PIT 校准及离散度与误差诊断,并保存总体和站点样本汇总结果。任务只有一个固定的 48-hour 预报时效且没有类别,因此不保存逐时效或逐类别指标。评估还生成 PIT 校准和概率误差对比结果。合成数据结果仅用于验证工程流程,无法代表论文正式性能。
result/evaluation/metrics.json
result/evaluation/ppnn_evaluation.png
OneScience 官方信息
| 平台 | OneScience 主仓库 | Skills 仓库 |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
引用与许可证
本仓库是对公开 PPNN 规范的独立工程复现。
本仓库代码、官方模型权重及数据的使用仍受各自项目的许可证和条款约束。
- Downloads last month
- 28