metnet

PyTorch Implementation of Google Research's MetNet and MetNet-2

https://github.com/openclimatefix/metnet

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.3%) to scientific vocabulary

Keywords

pytorch

Keywords from Contributors

pytorch-lightning pytorch-implementation nowcasting-precipitation nowcasting-models nowcasting gan eumetsat particles battery climate-model
Last synced: 9 months ago · JSON representation

Repository

PyTorch Implementation of Google Research's MetNet and MetNet-2

Basic Info
  • Host: GitHub
  • Owner: openclimatefix
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 185 KB
Statistics
  • Stars: 271
  • Watchers: 5
  • Forks: 53
  • Open Issues: 34
  • Releases: 43
Topics
pytorch
Created almost 5 years ago · Last pushed 9 months ago
Metadata Files
Readme License

README.md

MetNet and MetNet-2

All Contributors <!-- ALL-CONTRIBUTORS-BADGE:END -->

PyTorch Implementation of Google Research's MetNet for short term weather forecasting (https://arxiv.org/abs/2003.12140), inspired from https://github.com/tcapelle/metnetpytorch/tree/master/metnetpytorch

MetNet-2 (https://arxiv.org/pdf/2111.07470.pdf) is a further extension of MetNet that takes in a larger context image to predict up to 12 hours ahead, and is also implemented in PyTorch here.

Installation

Clone the repository, then run shell pip install -r requirements.txt pip install -e . `

Alternatively, you can also install a usually older version through pip install metnet

Please ensure that you're using Python version 3.9 or above.

Data

While the exact training data used for both MetNet and MetNet-2 haven't been released, the papers do go into some detail as to the inputs, which were GOES-16 and MRMS precipitation data, as well as the time period covered. We will be making those splits available, as well as a larger dataset that covers a longer time period, with HuggingFace Datasets! Note: The dataset is not available yet, we are still processing data!

```python from datasets import load_dataset

dataset = load_dataset("openclimatefix/goes-mrms") ```

This uses the publicly avaiilable GOES-16 data and the MRMS archive to create a similar set of data to train and test on, with various other splits available as well.

Pretrained Weights

Pretrained model weights for MetNet and MetNet-2 have not been publicly released, and there is some difficulty in reproducing their training. We release weights for both MetNet and MetNet-2 trained on cloud mask and satellite imagery data with the same parameters as detailed in the papers on HuggingFace Hub for MetNet and MetNet-2. These weights can be downloaded and used using:

python from metnet import MetNet, MetNet2 model = MetNet().from_pretrained("openclimatefix/metnet") model = MetNet2().from_pretrained("openclimatefix/metnet-2")

Example Usage

MetNet can be used with:

```python from metnet import MetNet import torch import torch.nn.functional as F

model = MetNet( hiddendim=32, forecaststeps=24, inputchannels=16, outputchannels=12, satchannels=12, inputsize=32, )

MetNet expects original HxW to be 4x the input size

x = torch.randn((2, 12, 16, 128, 128)) out = [] for leadtime in range(24): out.append(model(x, leadtime)) out = torch.stack(out, dim=1)

MetNet creates predictions for the center 1/4th

y = torch.randn((2, 24, 12, 8, 8)) F.mse_loss(out, y).backward() ```

And MetNet-2 with:

```python from metnet import MetNet2 import torch import torch.nn.functional as F

model = MetNet2( forecaststeps=8, inputsize=64, numinputtimesteps=6, upsamplerchannels=128, lstmchannels=32, encoderchannels=64, centercrop_size=16, )

MetNet expects original HxW to be 4x the input size

x = torch.randn((2, 6, 12, 256, 256)) out = [] for leadtime in range(8): out.append(model(x, leadtime)) out = torch.stack(out, dim=1) y = torch.rand((2,8,12,64,64)) F.mse_loss(out, y).backward() ```

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Jacob Bieker
Jacob Bieker

💻
Jack Kelly
Jack Kelly

💻
Valter Fallenius
Valter Fallenius

📓
terigenbuaa
terigenbuaa

💬
Kan.Dai
Kan.Dai

💬
Sailesh Bechar
Sailesh Bechar

💬
Rahul Maurya
Rahul Maurya

⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

Owner

  • Name: Open Climate Fix
  • Login: openclimatefix
  • Kind: organization
  • Email: info@openclimatefix.org
  • Location: London

Using open science to mitigate climate change

GitHub Events

Total
  • Create event: 1
  • Release event: 1
  • Issues event: 2
  • Watch event: 34
  • Issue comment event: 18
  • Push event: 47
  • Pull request event: 1
  • Pull request review event: 3
  • Pull request review comment event: 11
  • Fork event: 5
Last Year
  • Create event: 1
  • Release event: 1
  • Issues event: 2
  • Watch event: 34
  • Issue comment event: 18
  • Push event: 47
  • Pull request event: 1
  • Pull request review event: 3
  • Pull request review comment event: 11
  • Fork event: 5

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 166
  • Total Committers: 9
  • Avg Commits per committer: 18.444
  • Development Distribution Score (DDS): 0.53
Past Year
  • Commits: 2
  • Committers: 2
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Jacob Bieker j****b@b****h 78
BumpVersion Action b****n@g****s 37
Raahul Singh r****2@g****m 19
allcontributors[bot] 4****] 14
pre-commit-ci[bot] 6****] 13
peterdudfield p****d@h****m 2
Rahul Maurya 9****b 1
Jack Kelly j****k@O****g 1
Database Missing no1 9****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 34
  • Total pull requests: 31
  • Average time to close issues: 2 months
  • Average time to close pull requests: 25 days
  • Total issue authors: 20
  • Total pull request authors: 9
  • Average comments per issue: 2.97
  • Average comments per pull request: 1.48
  • Merged pull requests: 26
  • Bot issues: 0
  • Bot pull requests: 12
Past Year
  • Issues: 4
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 days
  • Issue authors: 4
  • Pull request authors: 1
  • Average comments per issue: 0.75
  • Average comments per pull request: 11.5
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jacobbieker (10)
  • ValterFallenius (4)
  • peterdudfield (2)
  • JackKelly (2)
  • ShileiCao (1)
  • CUITCHENSIYU (1)
  • codeastra2 (1)
  • NMC-DAVE (1)
  • terigenbuaa (1)
  • Nagessen (1)
  • lucasbs97 (1)
  • Raahul-Singh (1)
  • jramosss (1)
  • SaileshBechar (1)
  • dsuhoi (1)
Pull Request Authors
  • jacobbieker (11)
  • allcontributors[bot] (7)
  • pre-commit-ci[bot] (4)
  • Averagenormaljoe (2)
  • rahul-maurya11b (2)
  • ValterFallenius (1)
  • peterdudfield (1)
  • JackKelly (1)
  • Raahul-Singh (1)
Top Labels
Issue Labels
enhancement (16) bug (10) good first issue (4) documentation (2)
Pull Request Labels
enhancement (7)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 338 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 86
  • Total maintainers: 2
proxy.golang.org: github.com/openclimatefix/metnet
  • Versions: 44
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 9 months ago
pypi.org: metnet

PyTorch MetNet Implementation

  • Versions: 42
  • Dependent Packages: 0
  • Dependent Repositories: 2
  • Downloads: 338 Last month
Rankings
Stargazers count: 5.7%
Forks count: 6.4%
Dependent packages count: 7.3%
Average: 8.3%
Downloads: 10.5%
Dependent repos count: 11.8%
Maintainers (2)
Last synced: 9 months ago

Dependencies

requirements.txt pypi
  • antialiased_cnns *
  • axial_attention *
  • einops >=0.3.0
  • huggingface_hub *
  • numpy >=1.19.5
  • pytorch_msssim *
  • torchvision >=0.10.0
.github/workflows/release.yaml actions
.github/workflows/workflows.yaml actions
setup.py pypi