File size: 6,280 Bytes
87f2bd3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | ---
license: cc-by-4.0
language:
- en
tags:
- OneScience
- Earth Science
- Climate Prediction
- Regression
frameworks: PyTorch
---
<p align="center">
<strong><span style="font-size: 30px;">ClimEmu-S2L</span></strong>
</p>
# Model Introduction
ClimEmu-S2L predicts long-term climate-change patterns from the first 10 years of global near-surface temperature responses to reduce the cost of multi-scenario long-term climate simulations and support regional temperature-response analysis.
Paper: Predicting global patterns of long-term climate change from short-term simulations using machine learning
https://doi.org/10.1038/s41612-020-00148-5
# Model Description
The method reproduced by ClimEmu-S2L was proposed by research teams from Imperial College London, the University of Reading, the University of East Anglia, the University of Warwick, the Technical University of Crete, and collaborating institutions. The paper uses 21 HadGEM3 climate-forcing scenarios from projects including PDRMIP, ECLIPSE, and Kasoar. The model performs the task of predicting long-term spatial patterns from short-term global near-surface temperature responses and evaluates global and regional climate responses.
# Use Cases
| Use Case | Description |
| :---: | :--- |
| Long-term climate response prediction | Predict global long-term patterns after year 70 from the first 10 years of temperature response. |
| Ridge regression validation | Select regularization with inner cross-validation and execute 21-fold LOSO prediction. |
| GPR regression validation | Execute 21-fold LOSO prediction with shared-kernel Gaussian process regression. |
| ModelScope/OneCode execution | Execute full-grid training, inference, regional evaluation, and visualization in ModelScope or OneCode environments. |
| Multi-GPU training | Distribute the 21 LOSO folds across processes with `torchrun`. |
# Usage Instructions
## 1.OneCode
Experience intelligent, one-click AI4S programming through the OneCode online environment:
[Try intelligent, one-click AI4S programming](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)
## 2. Download and Installation
```bash
hf download OneScience-Group/ClimEmu-S2L --local-dir ./ClimEmu-S2L
cd ClimEmu-S2L
```
### 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**
```bash
# 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**
```bash
# 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
This repository uses a small set of structured synthetic climate-response samples to validate the engineering workflow, comprising 21 forcing scenarios of single-channel near-surface temperature anomalies on the complete `145×192` grid in `degC`. Inputs are the mean responses during the first 10 years of each scenario, and targets are the same-scenario long-term mean responses after year 70. The synthetic data preserve the scenario count, spatial grid, and time windows while reducing GPR to a shared non-ARD kernel structure and fewer kernel-optimization iterations to control engineering-validation cost; they do not represent the official HadGEM3 data distribution or training scale.
```bash
python scripts/fake_data.py
```
### Training
For single-device training, use:
```bash
python scripts/train.py
```
For multi-GPU training, use:
```bash
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
```
Training fits Ridge and GPR models over all 21 leave-one-scenario-out (LOSO) folds; Ridge selects regularization through inner three-fold cross-validation, while GPR optimizes a shared non-ARD kernel. Standard training artifacts are saved to:
```text
result/checkpoints/climemu_s2l.pt
result/training/metrics.json
```
### Trained Weights
This repository does not include weights under `weight/`. The paper does not provide a confirmed official checkpoint, and the current engineering checkpoint is not claimed to contain the paper's formal model parameters.
### Inference
```bash
python scripts/inference.py
```
Inference loads the training checkpoint and generates Ridge and GPR long-term response fields for all 21 scenarios. Complete numerical results are saved to:
```text
result/output/predictions.npz
```
### Evaluation and Visualization
```bash
python scripts/result.py
```
Evaluation reports area-weighted full-grid RMSE, global mean absolute error, and regional mean absolute error by method, per scenario, and per region; this is neither a multi-step nor classification task, so no per-step or per-class results are provided. Visualizations include target and prediction spatial maps and cross-scenario error boxplots, with structured results and figures saved to the paths below. Synthetic-data results validate the engineering workflow only and do not represent formal paper performance.
```text
result/evaluation/metrics.json
result/evaluation/spatial_fields.png
result/evaluation/error_boxplots.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 ClimEmu-S2L specifications.
Use of this repository's code, official model weights, and data remains subject to the licenses and terms of their respective projects.
|