DLWP-CS
Model Overview
DLWP-CS employs cubed-sphere convolutional neural networks for global weather forecasting, mitigating the geometric distortions that conventional latitude-longitude grids suffer near the poles.
Paper: Improving Data-Driven Global Weather Prediction Using Deep Convolutional Neural Networks on a Cubed Sphere
https://doi.org/10.1029/2020MS002109
Model Description
This directory provides an independent PyTorch structural smoke implementation based on the paper and official code, featuring cubed-sphere cross-face padding, convolutions, a simplified U-Net, capped leaky ReLU, and autoregressive inference. It is not a reproduction of the paper's experimental architecture or ERA5 training.
Use Cases
| Scenario | Description |
|---|---|
| Cubed-Sphere Architecture Research | Verify six-face adjacency, flipping, and convolution. |
| Local Rapid Verification | Run training and rollout with fake data. |
| ERA5 Global Weather Forecasting | Subsequently interface with ERA5 data processed via Tempest-Remap. |
Usage
1. OneCode
Click to experience intelligent one-click AI4S programming
2. Manual Installation & Usage
Hardware Requirements
- CPU can run the current minimum configuration.
- GPU is recommended for training on real data.
Download the Model Package
hf download OneScience-Group/deep-learning-weather-prediction --local-dir ./deep-learning-weather-prediction
cd deep-learning-weather-prediction
Set Up the Runtime Environment
DCU Environment
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
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
Data
The default training uses a deterministic fake Dataset from model/dataset.py and requires no additional download; each sample has shape [C,6,H,W], and the validation set uses an independent seed.
Training
python scripts/train.py
The script performs multi-epoch training, validation, learning rate scheduling, and early stopping:
- Generates fake data of shape
[C,6,H,W]by index; - Validates the six-face topology and capped leaky ReLU;
- Executes U-Net forward/backward, MSE loss, and optimization per epoch;
- Computes validation loss on an independent fake validation Dataset;
- Saves latest/best checkpoints and history; supports
--resume.
python scripts/train.py --epochs 10
python scripts/train.py --resume weight/training/latest.pth --epochs 20
Checkpoint outputs:
weight/model.pth
weight/training/latest.pth
weight/training/best.pth
weight/training/history.json
Inference
python scripts/inference.py
Inference results:
result/prediction.pt
result/target.pt
result/inference.json
Result Inspection
python scripts/result.py
The result script produces result/metrics.json and result/comparison.png. The current rmse and spatial_acc serve only as connectivity checks on fake tensors; they do not apply the denormalization, latitude-weighted area averaging, cubed-sphere inverse mapping, or daily climatological anomaly computation required by the paper.
Paper vs. Current Implementation I/O
| Item | Paper DLWP-CS | Current Smoke Implementation |
|---|---|---|
| Dynamic Input | 4 variables at t-6h,t, 8 channels |
2-channel single state with no physical semantics |
| Auxiliary Input | Solar radiation, land-sea mask, topography | Not implemented |
| Spatial Grid | [6,48,48] cubed sphere |
[6,8,8] fake grid |
| Output | 4 variables at t+6h,t+12h, 8 channels |
2-channel output of the same shape |
| Network / Training | Two-level U-Net, combined loss over two autoregressive steps | Single-level simplified U-Net, multi-epoch single-step MSE training |
| Analysis | Physical-unit, latitude-weighted RMSE/ACC | Smoke metrics without physical units |
The complete execution flow is train.py -> inference.py -> result.py. The fake Dataset preserves the cubed-sphere input shape but does not represent a continuous weather time series; the model package is distributed without local training weights or result/ artifacts. A production mode further requires an ERA5 Dataset implementation, CS48 remapping, 4 dynamic variables, auxiliary fields, normalization statistics, and the paper's two-step iterative training loss.
Real Data
Real-data training requires ERA5 variables Z500, Z1000, 300–700 hPa geopotential thickness, and 2 m temperature, along with solar radiation, a land-sea mask, topography, and Tempest-Remap offline remapping weights.
OneScience Official 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 & License
- Official Code: https://github.com/jweyn/DLWP-CS
- This directory is an independent adaptation based on the paper and official structure, licensed under GPL-3.0.
中文说明
模型概述
DLWP-CS 使用立方球面卷积神经网络进行全球天气预报(weather forecasting),缓解常规经纬度网格在两极附近的几何畸变。
论文《使用立方球面深度卷积神经网络改进数据驱动的全球天气预报》
https://doi.org/10.1029/2020MS002109
模型描述
本目录依据论文和官方代码提供独立的 PyTorch 结构冒烟测试实现。它包括立方球面跨面填充、卷积、简化 U-Net、带上限的 leaky ReLU 和自回归推理(inference)。论文中的实验架构及 ERA5 训练均未在此复现。
使用场景
| 场景 | 说明 |
|---|---|
| 立方球面架构研究 | 验证六个面的邻接关系、翻转与卷积。 |
| 本地快速验证 | 使用模拟数据运行训练和滚动预测。 |
| ERA5 全球天气预报 | 后续对接经 Tempest-Remap 处理的 ERA5 数据。 |
使用方法
1. OneCode
2. 手动安装与使用
硬件要求
- CPU 可以运行当前的最小配置。
- 建议使用 GPU 在真实数据上训练。
下载模型包
hf download OneScience-Group/deep-learning-weather-prediction --local-dir ./deep-learning-weather-prediction
cd deep-learning-weather-prediction
配置运行环境
DCU 环境
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 环境
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
数据
默认训练使用 model/dataset.py 中的确定性模拟 Dataset,无需额外下载。每个样本的形状为 [C,6,H,W],验证集使用独立的种子。
训练
python scripts/train.py
脚本执行多轮次训练、验证、学习率调度和提前停止,步骤如下。
- 按索引生成形状为
[C,6,H,W]的模拟数据。 - 验证六面拓扑和带上限的 leaky ReLU。
- 每轮执行 U-Net 的前向与反向计算、MSE 损失计算和优化。
- 在独立的模拟验证 Dataset 上计算验证损失。
- 保存最新和最佳的模型权重(检查点)(checkpoints)及历史记录,支持
--resume。
python scripts/train.py --epochs 10
python scripts/train.py --resume weight/training/latest.pth --epochs 20
模型权重(检查点)输出
weight/model.pth
weight/training/latest.pth
weight/training/best.pth
weight/training/history.json
推理
python scripts/inference.py
推理结果
result/prediction.pt
result/target.pt
result/inference.json
检查结果
python scripts/result.py
结果脚本生成 result/metrics.json 和 result/comparison.png。当前的 rmse 和 spatial_acc 仅用于对模拟张量进行连通性检查。论文所需的反归一化、按纬度加权的面积平均、立方球面逆映射和逐日气候距平计算均未执行。
论文与当前实现的输入输出对比
| 项目 | 论文中的 DLWP-CS | 当前冒烟测试实现 |
|---|---|---|
| 动态输入 | t-6h,t 时刻的 4 个变量,8 个通道 |
2 个通道的单一状态,无物理含义 |
| 辅助输入 | 太阳辐射、海陆掩膜、地形 | 未实现 |
| 空间网格 | [6,48,48] 立方球面 |
[6,8,8] 模拟网格 |
| 输出 | t+6h,t+12h 时刻的 4 个变量,8 个通道 |
同形状的 2 通道输出 |
| 网络 / 训练 | 两层 U-Net,结合两个自回归步骤的损失 | 单层简化 U-Net,多轮次单步 MSE 训练 |
| 分析 | 具有物理单位且按纬度加权的 RMSE/ACC | 无物理单位的冒烟测试指标 |
完整执行流程为 train.py -> inference.py -> result.py。模拟 Dataset 保留立方球面输入形状,但无法表示连续的天气时间序列。模型包分发时不包含本地训练权重或 result/ 产物。生产模式还需要 ERA5 Dataset 实现、CS48 重映射、4 个动态变量、辅助场、归一化统计量及论文中的两步迭代训练损失。
真实数据
真实数据训练需要 ERA5 变量 Z500、Z1000、300–700 hPa 位势厚度和 2 m 温度,还需要太阳辐射、海陆掩膜、地形以及 Tempest-Remap 离线重映射权重。
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 |
引用与许可证
- 官方代码见 https://github.com/jweyn/DLWP-CS
- 本目录是基于论文和官方结构的独立适配,采用 GPL-3.0 授权。
- Downloads last month
- 19