Prithvi WxC 基础模型的实现及下游任务
This repository contains the code of the Prithvi WxC foundation model as well as basic zero-shot examples for testing and illustration. For fine-tuning applications please refer to task-specific repositories listed below.
The previous version of this repo contained a number of bugs that led to incorrect model outputs and worse performance than in our paper. We just addressed these issues. In particular, there is validation code below that lets you verify whether your particular platform and version of the code obtains results comparable to ours. (See step 3 under Getting started.)
Prithvi WxC is at its core a scalable 2D vision transformer. The architecture is designed to allow for memory-efficient masked pretraining. It draws inspiration from both Hiera, MaxViT and SWIN transformers. Inputs, structured into windows, take the shape (batch, windows, tokens, features). We alternate between local attention (within a window) and global attention (across windows). This is implemented by transposing dimensions between transformer layers. Attention acts on the third dimension, the second being part of the batch. When data becomes dense -- i.e. in the absence of masking -- it is possible to add SWIN-like shifts to the local attention layers. See the figure for illustration:
We have fine-tuned the model to a number of downstream tasks. See the paper as well as the respective repository for details.
| Application | Dataset | Repository |
|---|---|---|
| Downscaling | MERRA-2 | https://github.com/IBM/granite-wxc |
| Downscaling | EURO-CORDEX | https://github.com/IBM/granite-wxc |
| Gravity wave parametrization | ERA5 | https://github.com/NASA-IMPACT/gravity-wave-finetuning |
Beyond these there are zero-shot applications in masked reconstruction and forecasting.
Create a virtual environment
Clone this repository and install Prithvi WxC as a module
git clone https://github.com/NASA-IMPACT/Prithvi-WxC
cd Prithvi-WxC
pip install '.[examples]'
Validate that the model behaves as expected. For that run
python -m validation.validate_prithvi_wxc -c validation/config.yaml
Run one of the notebooks in the examples directory:
These notebooks will download model weights as well as sample data for basic illustration from Hugging Face.
Prithvi WxC is a very flexible model. It has been pretrained on a pretext task blending masked reconstruction and forecasting so that it can be used for both zero-hours ahead as well as forecasting applications. Moreover, the masking pattern makes it suitable for both global and regional applications. There are currently two pretrained base models as well as several fine-tuning applications.
| Model | Details | Weights |
|---|---|---|
| prithvi.wxc.2300m.v1 | Pretrained 2.3B parameter model. Flexible input and lead time. For general and 0-hour ahead applications. | https://huggingface.co/Prithvi-WxC/prithvi.wxc.2300m.v1 |
| prithvi.wxc.rollout.2300m.v1 | Pretrained 2.3B parameter model. Input and lead time fixed to 6h. For forecasting applications. | https://huggingface.co/Prithvi-WxC/prithvi.wxc.rollout.2300m.v1 |
Prithvi WxC used data from the MERRA-2 reanalysis for pretraining. In particular, the model uses a climatology computed from MERRA-2 data. The climatology, too, is available via Hugging Face. See the paper for details on variables choosen and the methodology behind the climatology.
If you use this work, consider citing our paper
…
暂无开放 Issues,或尚未同步最近议题。