百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

constrained-downscaling

> 开发工具
开源

一个项目,探讨如何将物理约束纳入 深度学习 架构,以实现缩小或其他超分辨率任务。

100 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个项目,探讨如何将物理约束纳入 深度学习 架构,以实现缩小或其他超分辨率任务。

Physics-constrained deep learning for climate downscaling

This code belongs to a paper currently under review, a preprint can be found at: https://arxiv.org/pdf/2208.05424.pdf

Abstract: The availability of reliable, high-resolution climate and weather data is important to inform long-term decisions on climate adaptation and mitigation and to guide rapid responses to extreme events. Forecasting models are limited by computational costs and, therefore, often generate coarse-resolution predictions. Statistical downscaling can provide an efficient method of upsampling low-resolution data. In this field, deep learning has been applied successfully, often using image super-resolution methods from computer vision. However, despite achieving visually compelling results in some cases, such models frequently violate conservation laws when predicting physical variables. In order to conserve physical quantities, we develop methods that guarantee physical constraints are satisfied by a deep learning downscaling model while also improving their performance according to traditional metrics. We compare different constraining approaches and demonstrate their applicability across different neural architectures as well as a variety of climate and weather data sets. While our novel methodologies enable faster and more accurate climate predictions, we also show how they can improve super-resolution for satellite data and standard data sets.

Setup

Clone the repository and install the requirements

bash
$ git clone https://github.com/RolnickLab/constrained-downscaling.git
$ cd constrained-downscaling
$ conda env create -f requirements.yml
$ conda activate constrained-ds

Get the data

One of our main data sets, ERA5 total columnt water, 4x upsampling, can be downloaded in a ML-ready form at: https://drive.google.com/file/d/1IENhP1-aTYyqOkRcnmCIvxXkvUW2Qbdx/view?usp=sharing. For the other datasets, see bottom of the page.

You can use wget:

bash
$ wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1IENhP1-aTYyqOkRcnmCIvxXkvUW2Qbdx' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1IENhP1-aTYyqOkRcnmCIvxXkvUW2Qbdx" -O era5_sr_data.zip && rm -rf /tmp/cookies.txt

then unzip

bash
$ mkdir data/
$ unzip -o era5_sr_data.zip -d data/
$ rm era5_sr_data.zip 

Other data sets are available upon request from the author or can be generated by using public sources for ERA5 (https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-single-levels?tab=form.) and NorESM (https://esgf-index1.ceda.ac.uk/search/cmip6-ceda/) data.

Run training

To run our standard CNN withour constrained run

bash
$ python main.py --dataset era5_sr_data --model cnn --model_id twc_cnn_noconstraints --constraints none

To run with softmax constraining (hard constraining) run

bash
$ python main.py --dataset era5_sr_data --model cnn --model_id twc_cnn_softmaxconstraints --constraints softmax

To run with soft constraining run, with a factor of alpha run

bash
$ python main.py --dataset era5_sr_data --model cnn --model_id twc_cnn_softconstraints --constraints soft --loss mass_constraints --alpha 0.99

For other setups: --model can be either cnn, gan, convgru, flowconvgru (last two require different data sets) --constraints can be none, softmax, scadd, mult, add, soft other arguents are --epochs, --lr (learning rate), --number_residual_blocks, --weight_decay

Run inference

An example evaluation for the unconstrained model:

bash
$ python main.py --training_evalonly evalonly --dataset era5_sr_data --model cnn --model_id twc_cnn_noconstraints --constraints none

It produces a csv file with all metrics on either validation or test set.

Citation

The doi is: 10.5281/zenodo.8150694

If you find this repository helpful please consider citing our work

@misc{harder2022,
author = {Harder, Paula and Yang, Qidong and Ramesh, Venkatesh and Sattigeri, Prasanna and Hernandez-Garcia, Alex and Watson, Campbell and Szwarcman, Daniela and Rolnick, David},
  title = {Generating physically-consistent high-resolution climate data with hard-constrained neural networks},
  publisher = {arXiv}, 
  year = {2022}
}

Addional datasets

The WRF dataset can be found here for the 9km run: https://drive.google.com/file/d/1AJ1JkTk8ZhUkSI378oQTMSG9m9Y9H698/view?usp=drive_link and for the 3km run: https://drive.google.com/file/d/1VbO8VSpgdWcOB2PK6L9fRgluGwrbH6wL/view?usp=drive_link

The NorESM dataset here: https://drive.google.com/file/d/1D5tLE7cGcvh3dap-P3VOLEOK_7FqdChF/view?usp=sharing.

Issues· 2 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonclimatedownscalingemulationphysics-constrained

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具