openclimatefix/graph_weather
openclimatefix/graph_weather has 305 GitHub stars and 95 forks. GitHot measured 0 stars in 24 hours and -1 in 7 days. Last checked 2026-11-21 18:14 UTC. Last push 2026-11-16.
实测星标增长
- 24小时
- 0
- 7天
- -1
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
关于
Graph-based weather forecasting models. Originally, PyTorch implementation of Ryan Keisler's 2022 "Forecasting Global Weather with Graph Neural Networks" paper (https://arxiv.org/abs/2202.07575)
机器学习README.md
原文Graph Weather
This repo implements graph neural networks for weather forecasting, originally an implementation of the Graph Weather paper (https://arxiv.org/pdf/2202.07575.pdf) in PyTorch. Additionally, multiple other models have now been added, as well as general models for assimilation and forecasting.
The models implemented include:
DeepMind's Functional Generative Network (FGN) for probablistic ensemble forecasting
DeepMind's GenCast for graph diffusion-based forecasting
WindBorne's WeatherMesh-3 for highly efficient forecasting with Neighborhood Attention
WindBorne's WeatherMesh-4 for HEALPix-mesh global forecasting, with the weather state at depth 8 (~0.25-deg) and a coarser depth 5 (~1.8-deg) latent space
WindBorne's WeatherMesh-6 for 0.25-degree global forecasting with latent-space ensembles and matepoint activation offloading for long rollouts
Microsoft's Aurora forecasting model
And FengWu-GHR forecasting, using LoRA to correct for per-forecast step errors
The components of these models should be fairly modular and be able to be swapped around to experiment with graph-based weather forecasting.
Installation
This library can be installed through
pip install graph-weather
Alternatively, you can install the latest version from the repository easily with pixi:
pixi install # `-e cuda` for GPU support, `-e cpu` for CPU-only
Example Usage
The models generate the graphs internally, so the only thing that needs to be passed to the model is the node features
in the same order as the lat_lons.
import torch
from graph_weather import GraphWeatherForecaster
from graph_weather.models.losses import NormalizedMSELoss
lat_lons = []
for lat in range(-90, 90, 1):
for lon in range(0, 360, 1):
lat_lons.append((lat, lon))
model = GraphWeatherForecaster(lat_lons)
# Generate 78 random features + 24 non-NWP features (i.e. landsea mask)
features = torch.randn((2, len(lat_lons), 102))
target = torch.randn((2, len(lat_lons), 78))
out = model(features)
criterion = NormalizedMSELoss(lat_lons=lat_lons, feature_variance=torch.randn((78,)))
loss = criterion(out, target)
loss.backward()
And for the assimilation model, which assumes each lat/lon point also has a height above ground, and each observation is a single value + the relative time. The assimlation model also assumes the desired output grid is given to it as well.
import torch
import numpy as np
from graph_weather import GraphWeatherAssimilator
from graph_weather.models.losses import NormalizedMSELoss
obs_lat_lons = []
for lat in range(-90, 90, 7):
for lon in range(0, 180, 6):
obs_lat_lons.append((lat, lon, np.random.random(1)))
for lon in 360 * np.random.random(100):
obs_lat_lons.append((lat, lon, np.random.random(1)))
output_lat_lons = []
for lat in range(-90, 90, 5):
for lon in range(0, 360, 5):
output_lat_lons.append((lat, lon))
model = GraphWeatherAssimilator(output_lat_lons=output_lat_lons, analysis_dim=24)
features = torch.randn((1, len(obs_lat_lons), 2))
lat_lon_heights = torch.tensor(obs_lat_lons)
out = model(features, lat_lon_heights)
assert not torch.isnan(out).all()
assert out.size() == (1, len(output_lat_lons), 24)
criterion = torch.nn.MSELoss()
loss = criterion(out, torch.randn((1, len(output_lat_lons), 24)))
loss.backward()
Pretrained Weights
Coming soon! We plan to train a model on GFS 0.25 degree operational forecasts, as well as MetOffice NWP forecasts. We also plan trying out adaptive meshes, and predicting future satellite imagery as well.
Training Data
Training data will be available through HuggingFace Datasets for the GFS forecasts. The initial set of data is available for GFSv16 forecasts, raw observations, and FNL Analysis files from 2016 to 2022, and for ERA5 Reanlaysis. MetOffice NWP forecasts we cannot redistribute, but can be accessed through CEDA.
Contributors ✨
Thanks goes to these wonderful people (emoji key):
Jacob Bieker 💻 |
Jack Kelly 🤔 |
byphilipp 🤔 |
Markus Kaukonen 💬 |
MoHawastaken 🐛 |
Mihai 💬 |
Vitus Benson 🐛 |
dongZheX 💬 |
sabbir2331 💬 |
Lorenzo Breschi 💻 |
gbruno16 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
探索相关项目
加载中…