Learning (Tensorized) Neural Operators in PyTorch.
Project description
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 .
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 TFNO
operator = TFNO(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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for neuraloperator-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbc8b1d1c9d7eb573cc7e45ccf7286599f6d95d98953b72167668c1f94f0f9a8 |
|
MD5 | 6c5ee7490b555cf7ffa3d0d30cb8b0cd |
|
BLAKE2b-256 | 7adb0207ef895e438f664b34305070b95180740d6ab4926b4482474c082718c2 |