microsoft-aurora


Namemicrosoft-aurora JSON
Version 1.4.0 PyPI version JSON
download
home_pageNone
SummaryImplementation of the Aurora model
upload_time2024-10-09 17:37:17
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Implementation of the Aurora model. Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords atmospheric chemistry atmospheric dynamics aurora model deep learning foundation models
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
    <img src="docs/aurora.jpg" alt="Aurora logo" width="200"/>
</p>

# Aurora: A Foundation Model of the Atmosphere

[![CI](https://github.com/microsoft/Aurora/actions/workflows/ci.yaml/badge.svg)](https://github.com/microsoft/Aurora/actions/workflows/ci.yaml)
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://microsoft.github.io/aurora)
[![Paper](https://img.shields.io/badge/arXiv-2405.13063-blue)](https://arxiv.org/abs/2405.13063)

Implementation of the Aurora model for atmospheric forecasting.

_The package currently includes the pretrained model and the fine-tuned version for high-resolution weather forecasting._
_We are working on the fine-tuned version for air pollution forecasting, which will be included in due time._

[Link to the paper on arXiv.](https://arxiv.org/abs/2405.13063)

[Please see the documentation for detailed instructions and more examples.](https://microsoft.github.io/aurora)
You can also directly go to [a full-fledged example that runs the model on ERA5](https://microsoft.github.io/aurora/example_era5.html).

Cite us as follows:

```
@misc{bodnar2024aurora,
    title = {Aurora: A Foundation Model of the Atmosphere},
    author = {Cristian Bodnar and Wessel P. Bruinsma and Ana Lucic and Megan Stanley and Johannes Brandstetter and Patrick Garvan and Maik Riechert and Jonathan Weyn and Haiyu Dong and Anna Vaughan and Jayesh K. Gupta and Kit Tambiratnam and Alex Archibald and Elizabeth Heider and Max Welling and Richard E. Turner and Paris Perdikaris},
    year = {2024},
    url = {https://arxiv.org/abs/2405.13063},
    eprint = {2405.13063},
    archivePrefix = {arXiv},
    primaryClass = {physics.ao-ph},
}
```

Contents:

- [What is Aurora?](#what-is-aurora)
- [Getting Started](#getting-started)
- [Contributing](#contributing)
- [License](#license)
- [Security](#security)
- [Responsible AI Transparency Documentation](#responsible-ai-transparency-documentation)
- [Trademarks](#trademarks)
- [FAQ](#faq)

## What is Aurora?

Aurora is a machine learning model that can predict atmospheric variables, such as temperature.
It is a _foundation model_, which means that it was first generally trained on a lot of data,
and then can be adapted to specialised atmospheric forecasting tasks with relatively little data.
We provide three such specialised versions:
one for medium-resolution weather prediction,
one for high-resolution weather prediction,
and one for air pollution prediction.

## Getting Started

Install with `pip`:

```bash
pip install microsoft-aurora
```

Or with `conda` / `mamba`:

```bash
mamba install microsoft-aurora -c conda-forge
```

Run the pretrained small model on random data:

```python
from datetime import datetime

import torch

from aurora import AuroraSmall, Batch, Metadata

model = AuroraSmall()

model.load_checkpoint("microsoft/aurora", "aurora-0.25-small-pretrained.ckpt")

batch = Batch(
    surf_vars={k: torch.randn(1, 2, 17, 32) for k in ("2t", "10u", "10v", "msl")},
    static_vars={k: torch.randn(17, 32) for k in ("lsm", "z", "slt")},
    atmos_vars={k: torch.randn(1, 2, 4, 17, 32) for k in ("z", "u", "v", "t", "q")},
    metadata=Metadata(
        lat=torch.linspace(90, -90, 17),
        lon=torch.linspace(0, 360, 32 + 1)[:-1],
        time=(datetime(2020, 6, 1, 12, 0),),
        atmos_levels=(100, 250, 500, 850),
    ),
)

prediction = model.forward(batch)

print(prediction.surf_vars["2t"])
```

Note that this will incur a 500 MB download.

Please read the [documentation](https://microsoft.github.io/aurora) for more detailed instructions and for which models are available.

## Contributing

See [`CONTRIBUTING.md`](CONTRIBUTING.md).

## License

See [`LICENSE.txt`](LICENSE.txt).

## Security

See [`SECURITY.md`](SECURITY.md).

## Responsible AI Transparency Documentation

An AI system includes not only the technology, but also the people who will use it, the people who will be affected by it, and the environment in which it is deployed.
Creating a system that is fit for its intended purpose requires an understanding of how the technology works, its capabilities and limitations, and how to achieve the best performance.
Microsoft has a broad effort to put our AI principles into practice.
To find out more, see [Responsible AI principles from Microsoft](https://www.microsoft.com/en-us/ai/responsible-ai).

### Use of this code
Our goal in publishing this code is
(1) to facilitate reproducibility of our paper and
(2) to support and accelerate further research into foundation model for atmospheric forecasting.
This code has not been developed nor tested for non-academic purposes and hence should not be used as such.

### Limitations
Although Aurora was trained to accurately predict future weather and air pollution,
Aurora is based on neural networks, which means that there are no strict guarantees that predictions will always be accurate.
Altering the inputs, providing a sample that was not in the training set,
or even providing a sample that was in the training set but is simply unlucky may result in arbitrarily poor predictions.
In addition, even though Aurora was trained on a wide variety of data sets,
it is possible that Aurora inherits biases present in any one of those data sets.
A forecasting system like Aurora is only one piece of the puzzle in a weather prediction pipeline,
and its outputs are not meant to be directly used by people or businesses to plan their operations.
A series of additional verification tests are needed before it can become operationally useful.

### Data
The models included in the code have been trained on a variety of publicly available data.
A description of all data, including download links, can be found in [Supplementary C of the paper](https://arxiv.org/pdf/2405.13063).
The checkpoints include data from ERA5, CMCC, IFS-HR, HRES T0, GFS T0 analysis, and GFS forecasts.

### Evaluations
All versions of Aurora were extensively evaluated by evaluating predictions on data not seen during training.
These evaluations not only compare measures of accuracy, such as the root mean square error and anomaly correlation coefficient,
but also look at the behaviour in extreme situations, like extreme heat and cold, and rare events, like Storm Ciarán in 2023.
These evaluations are the main topic of [the paper](https://arxiv.org/pdf/2405.13063).

*Note: The documentation included in this file is for informational purposes only and is not intended to supersede the applicable license terms.*

## Trademarks

This project may contain trademarks or logos for projects, products, or services.
Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.

## FAQ

### How do I setup the repo for local development?

First, install the repository in editable mode and setup `pre-commit`:

```bash
make install
```

To run the tests and print coverage, run

```bash
make test
```

You can then explore the coverage in the browser by opening `htmlcov/index.html`.

To locally build the documentation, run

```bash
make docs
```

To locally view the documentation, open `docs/_build/index.html` in your browser.

### Why is the fine-tuned version of Aurora for air quality forecasting missing?

The package currently includes the pretrained model and the fine-tuned version for high-resolution weather forecasting.
We are working on the fine-tuned version for air pollution forecasting, which will be included in due time.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "microsoft-aurora",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "atmospheric chemistry, atmospheric dynamics, aurora model, deep learning, foundation models",
    "author": null,
    "author_email": "Cris Bodnar <crisbodnar96@gmail.com>, Wessel Bruinsma <wbruinsma@microsoft.com>, Ana Lucic <ana.lucic@microsoft.com>, Megan Stanley <meganstanley@microsoft.com>, Patrick Garvan <pgarvan@microsoft.com>, Johannes Brandstetter <brandstetter@ml.jku.at>, \"Richard E. Turner\" <t-rturner@microsoft.com>, Paris Perdikaris <paperdikaris@microsoft.com>",
    "download_url": "https://files.pythonhosted.org/packages/18/58/908a17da40e54bdda471bcd648c5b6f29928f75512b881ad66821b973113/microsoft_aurora-1.4.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n    <img src=\"docs/aurora.jpg\" alt=\"Aurora logo\" width=\"200\"/>\n</p>\n\n# Aurora: A Foundation Model of the Atmosphere\n\n[![CI](https://github.com/microsoft/Aurora/actions/workflows/ci.yaml/badge.svg)](https://github.com/microsoft/Aurora/actions/workflows/ci.yaml)\n[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://microsoft.github.io/aurora)\n[![Paper](https://img.shields.io/badge/arXiv-2405.13063-blue)](https://arxiv.org/abs/2405.13063)\n\nImplementation of the Aurora model for atmospheric forecasting.\n\n_The package currently includes the pretrained model and the fine-tuned version for high-resolution weather forecasting._\n_We are working on the fine-tuned version for air pollution forecasting, which will be included in due time._\n\n[Link to the paper on arXiv.](https://arxiv.org/abs/2405.13063)\n\n[Please see the documentation for detailed instructions and more examples.](https://microsoft.github.io/aurora)\nYou can also directly go to [a full-fledged example that runs the model on ERA5](https://microsoft.github.io/aurora/example_era5.html).\n\nCite us as follows:\n\n```\n@misc{bodnar2024aurora,\n    title = {Aurora: A Foundation Model of the Atmosphere},\n    author = {Cristian Bodnar and Wessel P. Bruinsma and Ana Lucic and Megan Stanley and Johannes Brandstetter and Patrick Garvan and Maik Riechert and Jonathan Weyn and Haiyu Dong and Anna Vaughan and Jayesh K. Gupta and Kit Tambiratnam and Alex Archibald and Elizabeth Heider and Max Welling and Richard E. Turner and Paris Perdikaris},\n    year = {2024},\n    url = {https://arxiv.org/abs/2405.13063},\n    eprint = {2405.13063},\n    archivePrefix = {arXiv},\n    primaryClass = {physics.ao-ph},\n}\n```\n\nContents:\n\n- [What is Aurora?](#what-is-aurora)\n- [Getting Started](#getting-started)\n- [Contributing](#contributing)\n- [License](#license)\n- [Security](#security)\n- [Responsible AI Transparency Documentation](#responsible-ai-transparency-documentation)\n- [Trademarks](#trademarks)\n- [FAQ](#faq)\n\n## What is Aurora?\n\nAurora is a machine learning model that can predict atmospheric variables, such as temperature.\nIt is a _foundation model_, which means that it was first generally trained on a lot of data,\nand then can be adapted to specialised atmospheric forecasting tasks with relatively little data.\nWe provide three such specialised versions:\none for medium-resolution weather prediction,\none for high-resolution weather prediction,\nand one for air pollution prediction.\n\n## Getting Started\n\nInstall with `pip`:\n\n```bash\npip install microsoft-aurora\n```\n\nOr with `conda` / `mamba`:\n\n```bash\nmamba install microsoft-aurora -c conda-forge\n```\n\nRun the pretrained small model on random data:\n\n```python\nfrom datetime import datetime\n\nimport torch\n\nfrom aurora import AuroraSmall, Batch, Metadata\n\nmodel = AuroraSmall()\n\nmodel.load_checkpoint(\"microsoft/aurora\", \"aurora-0.25-small-pretrained.ckpt\")\n\nbatch = Batch(\n    surf_vars={k: torch.randn(1, 2, 17, 32) for k in (\"2t\", \"10u\", \"10v\", \"msl\")},\n    static_vars={k: torch.randn(17, 32) for k in (\"lsm\", \"z\", \"slt\")},\n    atmos_vars={k: torch.randn(1, 2, 4, 17, 32) for k in (\"z\", \"u\", \"v\", \"t\", \"q\")},\n    metadata=Metadata(\n        lat=torch.linspace(90, -90, 17),\n        lon=torch.linspace(0, 360, 32 + 1)[:-1],\n        time=(datetime(2020, 6, 1, 12, 0),),\n        atmos_levels=(100, 250, 500, 850),\n    ),\n)\n\nprediction = model.forward(batch)\n\nprint(prediction.surf_vars[\"2t\"])\n```\n\nNote that this will incur a 500 MB download.\n\nPlease read the [documentation](https://microsoft.github.io/aurora) for more detailed instructions and for which models are available.\n\n## Contributing\n\nSee [`CONTRIBUTING.md`](CONTRIBUTING.md).\n\n## License\n\nSee [`LICENSE.txt`](LICENSE.txt).\n\n## Security\n\nSee [`SECURITY.md`](SECURITY.md).\n\n## Responsible AI Transparency Documentation\n\nAn AI system includes not only the technology, but also the people who will use it, the people who will be affected by it, and the environment in which it is deployed.\nCreating a system that is fit for its intended purpose requires an understanding of how the technology works, its capabilities and limitations, and how to achieve the best performance.\nMicrosoft has a broad effort to put our AI principles into practice.\nTo find out more, see\u202f[Responsible AI principles from Microsoft](https://www.microsoft.com/en-us/ai/responsible-ai).\n\n### Use of this code\nOur goal in publishing this code is\n(1) to facilitate reproducibility of our paper and\n(2) to support and accelerate further research into foundation model for atmospheric forecasting.\nThis code has not been developed nor tested for non-academic purposes and hence should not be used as such.\n\n### Limitations\nAlthough Aurora was trained to accurately predict future weather and air pollution,\nAurora is based on neural networks, which means that there are no strict guarantees that predictions will always be accurate.\nAltering the inputs, providing a sample that was not in the training set,\nor even providing a sample that was in the training set but is simply unlucky may result in arbitrarily poor predictions.\nIn addition, even though Aurora was trained on a wide variety of data sets,\nit is possible that Aurora inherits biases present in any one of those data sets.\nA forecasting system like Aurora is only one piece of the puzzle in a weather prediction pipeline,\nand its outputs are not meant to be directly used by people or businesses to plan their operations.\nA series of additional verification tests are needed before it can become operationally useful.\n\n### Data\nThe models included in the code have been trained on a variety of publicly available data.\nA description of all data, including download links, can be found in [Supplementary C of the paper](https://arxiv.org/pdf/2405.13063).\nThe checkpoints include data from ERA5, CMCC, IFS-HR, HRES T0, GFS T0 analysis, and GFS forecasts.\n\n### Evaluations\nAll versions of Aurora were extensively evaluated by evaluating predictions on data not seen during training.\nThese evaluations not only compare measures of accuracy, such as the root mean square error and anomaly correlation coefficient,\nbut also look at the behaviour in extreme situations, like extreme heat and cold, and rare events, like Storm Ciar\u00e1n in 2023.\nThese evaluations are the main topic of [the paper](https://arxiv.org/pdf/2405.13063).\n\n*Note: The documentation included in this file is for informational purposes only and is not intended to supersede the applicable license terms.*\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services.\nAuthorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n\n## FAQ\n\n### How do I setup the repo for local development?\n\nFirst, install the repository in editable mode and setup `pre-commit`:\n\n```bash\nmake install\n```\n\nTo run the tests and print coverage, run\n\n```bash\nmake test\n```\n\nYou can then explore the coverage in the browser by opening `htmlcov/index.html`.\n\nTo locally build the documentation, run\n\n```bash\nmake docs\n```\n\nTo locally view the documentation, open `docs/_build/index.html` in your browser.\n\n### Why is the fine-tuned version of Aurora for air quality forecasting missing?\n\nThe package currently includes the pretrained model and the fine-tuned version for high-resolution weather forecasting.\nWe are working on the fine-tuned version for air pollution forecasting, which will be included in due time.\n",
    "bugtrack_url": null,
    "license": "MIT License  Implementation of the Aurora model.  Copyright (c) Microsoft Corporation.  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Implementation of the Aurora model",
    "version": "1.4.0",
    "project_urls": {
        "repository": "https://github.com/microsoft/aurora"
    },
    "split_keywords": [
        "atmospheric chemistry",
        " atmospheric dynamics",
        " aurora model",
        " deep learning",
        " foundation models"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "42eb346fcc001f18b3a0689fb6c1787fa60efc64f7173861b48e47bebaf39b36",
                "md5": "c3da37d34964b993f5bd4c11a68bf1c6",
                "sha256": "0004c2905233511478505a8a82d0c05ec708fceebe33329eebb0f654660e8124"
            },
            "downloads": -1,
            "filename": "microsoft_aurora-1.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c3da37d34964b993f5bd4c11a68bf1c6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 186047,
            "upload_time": "2024-10-09T17:37:15",
            "upload_time_iso_8601": "2024-10-09T17:37:15.804690Z",
            "url": "https://files.pythonhosted.org/packages/42/eb/346fcc001f18b3a0689fb6c1787fa60efc64f7173861b48e47bebaf39b36/microsoft_aurora-1.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1858908a17da40e54bdda471bcd648c5b6f29928f75512b881ad66821b973113",
                "md5": "1207f95f0537eb063f5b458ef4036424",
                "sha256": "157a57105a1322964ce04dee4ca4a49fe8f01328da5af7804d76202a3e231dea"
            },
            "downloads": -1,
            "filename": "microsoft_aurora-1.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1207f95f0537eb063f5b458ef4036424",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 177604,
            "upload_time": "2024-10-09T17:37:17",
            "upload_time_iso_8601": "2024-10-09T17:37:17.413423Z",
            "url": "https://files.pythonhosted.org/packages/18/58/908a17da40e54bdda471bcd648c5b6f29928f75512b881ad66821b973113/microsoft_aurora-1.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-09 17:37:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "microsoft",
    "github_project": "aurora",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "microsoft-aurora"
}
        
Elapsed time: 0.49234s