Coder Social home page Coder Social logo

helgehr / neuraloperator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from neuraloperator/neuraloperator

0.0 0.0 0.0 42.53 MB

Learning in infinite dimension with neural operators.

Home Page: https://neuraloperator.github.io/neuraloperator/dev/index.html

License: MIT License

Python 100.00%

neuraloperator's Introduction

PyPI

Neural Operator

neuraloperator is a comprehensive library for learning neural operators in PyTorch. It is the official implementation for Fourier Neural Operators and Tensorized Neural Operators.

Unlike regular neural networks, neural operators enable learning mapping between function spaces, and this library provides all of the tools to do so on your own data.

NeuralOperators are also resolution invariant, so your trained operator can be applied on data of any resolution.

Installation

Just clone the repository and install locally (in editable mode so changes in the code are immediately reflected without having to reinstall):

git clone https://github.com/NeuralOperator/neuraloperator
cd neuraloperator
pip install -e .
pip install -r requirements.txt

You can also just pip install the library:

pip install neuraloperator

Quickstart

After you've installed the library, you can start training operators seemlessly:

from neuralop.models import FNO

operator = FNO(n_modes=(16, 16), hidden_channels=64,
                in_channels=3, out_channels=1)

Tensorization is also provided out of the box: you can improve the previous models by simply using a Tucker Tensorized FNO with just a few parameters:

from neuralop.models import TFNO

operator = TFNO(n_modes=(16, 16), hidden_channels=64,
                in_channels=3,
                out_channels=1,
                factorization='tucker',
                implementation='factorized',
                rank=0.05)

This will use a Tucker factorization of the weights. The forward pass will be efficient by contracting directly the inputs with the factors of the decomposition. The Fourier layers will have 5% of the parameters of an equivalent, dense Fourier Neural Operator!

Checkout the documentation for more!

Using with weights and biases

Create a file in neuraloperator/config called wandb_api_key.txt and paste your Weights and Biases API key there. You can configure the project you want to use and your username in the main yaml configuration files.

Contributing code

All contributions are welcome! So if you spot a bug or even a typo or mistake in the documentation, please report it, and even better, open a Pull-Request on GitHub. Before you submit your changes, you should make sure your code adheres to our style-guide. The easiest way to do this is with black:

pip install black
black .

Running the tests

Testing and documentation are an essential part of this package and all functions come with uni-tests and documentation. The tests are ran using the pytest package. First install pytest:

pip install pytest

Then to run the test, simply run, in the terminal:

pytest -v neuralop

Citing

If you use NeuralOperator in an academic paper, please cite [1], [2]:

@misc{li2020fourier,
   title={Fourier Neural Operator for Parametric Partial Differential Equations},
   author={Zongyi Li and Nikola Kovachki and Kamyar Azizzadenesheli and Burigede Liu and Kaushik Bhattacharya and Andrew Stuart and Anima Anandkumar},
   year={2020},
   eprint={2010.08895},
   archivePrefix={arXiv},
   primaryClass={cs.LG}
}

@article{kovachki2021neural,
   author    = {Nikola B. Kovachki and
                  Zongyi Li and
                  Burigede Liu and
                  Kamyar Azizzadenesheli and
                  Kaushik Bhattacharya and
                  Andrew M. Stuart and
                  Anima Anandkumar},
   title     = {Neural Operator: Learning Maps Between Function Spaces},
   journal   = {CoRR},
   volume    = {abs/2108.08481},
   year      = {2021},
}
[1]Li, Z., Kovachki, N., Azizzadenesheli, K., Liu, B., Bhattacharya, K., Stuart, A., and Anandkumar A., “Fourier Neural Operator for Parametric Partial Differential Equations”, ICLR, 2021. doi:10.48550/arXiv.2010.08895.
[2]Kovachki, N., Li, Z., Liu, B., Azizzadenesheli, K., Bhattacharya, K., Stuart, A., and Anandkumar A., “Neural Operator: Learning Maps Between Function Spaces”, JMLR, 2021. doi:10.48550/arXiv.2108.08481.

neuraloperator's People

Contributors

jeankossaifi avatar dhpitt avatar m4e7 avatar ashiq24 avatar crwhite14 avatar kovachki avatar rtu715 avatar btolooshams avatar bonevbs avatar zongyi-li avatar sleepyeye avatar imanliao avatar juliusberner avatar rybchuk avatar helgehr avatar samaonline avatar robertboy18 avatar gegewen avatar slanthaler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.