Neuraloperator

Latest version: v1.0.2

Safety actively analyzes 722460 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.0.2

What's new
This is a minor release to fix an issue in the pypi package.

*Full list of changes:*
* Fixes to doc workflow by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/496
* FIX workflow syntax by JeanKossaifi in https://github.com/neuraloperator/neuraloperator/pull/498
* Update sphinx gallery index by JeanKossaifi in https://github.com/neuraloperator/neuraloperator/pull/504
* added sources to include for sdist by sarthakpati in https://github.com/neuraloperator/neuraloperator/pull/506

New Contributors
* sarthakpati made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/506

**Full Changelog**: https://github.com/neuraloperator/neuraloperator/compare/1.0.1...1.0.2

1.0.1

What's Changed

Minor update that fixes loading the model's loading/saving: previously it would cause the optimizer to not update the correct parameters.

* (fix) Bump Darcy dataset version for proper shapes by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/490
* (fix) Remove `from_checkpoint` in `load_training_state` to avoid overwriting model by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/491
* Update citation for our white paper! by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/492
* Save metadata in `BaseModel.state_dict()`, check version tag in `BaseModel.load_state_dict()` by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/493
* remove ref tag from stable doc workflow by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/495

**Full Changelog**: https://github.com/neuraloperator/neuraloperator/compare/1.0.0...1.0.1

1.0.0

Neuralop 1.0 release notes

We are excited to release version 1.0 of `neuraloperator`. It is the result of a larger group effort, a year in the making, and introduces significant updates to NeuralOperator, enhancing usability, extending capabilities, and optimizing performance for neural operator models. Key improvements span models, layers, training, data handling, and documentation.

It introduces many new features and improvements, including:
• **New Training Framework**: Refactored Trainer class, GPU-accelerated DataProcessor, and streamlined training and evaluation workflows.
• **Cutting-edge Architectures** (GINO, UQNO, LocalFNO)
• **New Operator Blocks** including Transformer based and DISCO convolutions
• **Built-in Datasets**: Classic PDE datasets (Darcy Flow, Navier-Stokes) + new Car-CFD dataset for geometric simulations.
• **Smarter Algorithms**: Incremental spectral learning and mixed-precision training for efficiency
• **Improved Documentation**: Updated Quickstart Guide, new examples, and 80%+ test coverage

In addition, a number of optimizations, including fixes for numerical stability, training state handling, and improved batch processing, make this release smoother and more efficient for users working with large-scale models.



New training framework

This class introduces a fully refactored Trainer class for easier training. A new DataProcessor module takes care of data-processing directly on GPU, allowing for more flexibility for various usecases such as auto-regressive training or inference. The `Callbacks` mechanism has also been removed in favor of a cleaner, modular, and more extensible Trainer. This improves clarity and ease of use.

- You can now evaluate before training your model:

>>> model, optimizer, scheduler, _ = load_training_state(...)

>>> trainer = Trainer(model, n_epochs, ... device='cuda', ...)
>>> trainer.evaluate({'h1': H1Loss()}, test_loader)

0.0252

- Resuming training states is also simplified, and compatible with multi-device setups:

>>> trainer = Trainer(... device=device, use_distributed=True)
>>> trainer.train(..., resume_from_dir="./checkpoints", ...)
Trainer resuming from epoch 5...


The Trainer accepts a `DataProcessor` module to streamline data pre- and post-processing. Explicit `train()` and `eval()` modes were also added to the `DataProcessor`, making the behavior during training and evaluation clearer and more explicit.

Last, logging has been reintroduced into the `Trainer`, including better integration with Weights and Biases (WandB) for experiment tracking.

For an example of the new Trainer in action, check out our [interactive training example](https://neuraloperator.github.io/dev/auto_examples/plot_FNO_darcy.html)!


New neural operator architectures

GINO

The GINO ([Geometry-Informed Neural Operator](https://arxiv.org/abs/2309.00583)) architecture brings the FNO's ability to learn complex dynamics to irregular geometries. The GINO maps between functions provided at arbitrary input coordinates. For maximum modularity, the GINO is composed of configurable `GNOBlock` and `FNOBlock` operator layers.

To see example usage, check out the training recipe in `scripts/train_gino_carcfd.py`.


UQNO

The UQNO implements [Uncertainty Quantification for Operator Learning](https://openreview.net/pdf?id=cGpegxy12T), thanks to ziqi-ma and dhpitt. For an example training recipe see `scripts/train_uqno_darcy.py`.



LocalFNO

The [Local Fourier Neural Operator](https://arxiv.org/abs/2402.16845) shares its forward pass and architecture with the standard FNO, with the key difference that its Fourier convolution layers are replaced with LocalFNOBlocks that place differential kernel layers and local integral layers in parallel to its Fourier layers.Thanks to mliuschi.

New neural operator blocks

Attention kernel integral
The `AttentionKernelIntegral`, by zijieli-Jlee brings the multi-head attention mechanism to operator learning.


Codomain-Attention Blocks
`CODABlocks`, by ashiq24, implements [Codomain Attention Neural Operators](https://arxiv.org/pdf/2403.12553), an operator block that extends transformer positional encoding, self-attention and normalization functionalities to function spaces.


Differential convolution
Implements the finite difference convolution required for [Local Neural Operators](https://arxiv.org/abs/2402.16845). The `DifferentialConv` computes a finite difference convolution on a regular grid, which converges to a directional derivative as the grid is refined. Thanks to mliuschi.

DISCO convolutions
`DiscreteContinuousConv2d` implements Discrete-Continuous Convolutions required for Local Neural Operators. Check our documentation for an [interactive demo](https://neuraloperator.github.io/dev/auto_examples/plot_DISCO_convolutions.html) of DISCO convolutions in use! Thanks to mliuschi and bonevbs.

GNOBlock
This layer implements the [Graph Neural Operator](https://arxiv.org/abs/2003.03485) architecture, which combines a spatial neighbor search with a pointwise aggregation to create a kernel integral similar to message-passing neural network.

LocalFNOBlock
- Adds a `LocalFNOBlocks` layer, which mirrors the `FNOBlock` architecture with differential and discrete-continuous convolutions in parallel to normal spectral convolutions ([468](https://github.com/neuraloperator/neuraloperator/pull/468))

Updates to existing models/layers

FNO

We've simplifies the FNO's documentation and initialization. Parameters are now ordered by importance, and init only requires values for the most crucial parameters

- Creating an FNO is now as simple as:

>>> from neuralop.models import FNO
>>> model = FNO(n_modes=(12,12), in_channels=1, out_channels=1, hidden_channels=64)
>>> model
FNO(
(positional_embedding): GridEmbeddingND()
(fno_blocks): FNOBlocks(
(convs): SpectralConv(
(weight): ModuleList(
(0-3): 4 x DenseTensor(shape=torch.Size([64, 64, 12, 7]), rank=None)
)
)
... torch.nn.Module printout truncated ...

We've also added support for functions that take on complex values in the spatial domain ([400](https://github.com/neuraloperator/neuraloperator/pull/400))

FNO-GNO

The FNOGNO combines `FNOBlocks` over a regular grid with a `GNOBlock` layer to map to arbitrary query points in the spatial domain. Updates include simplifications of parameters and documentation, and modularization to integrate the new `GNOBlock` layer.

New meta algorithms

Incremental learning of resolution and frequency
Implements [Incremental Spectral Learning](https://arxiv.org/pdf/2211.15188) to learn the smallest possible model for a given problem.

- Adds `IncrementalDataProcessor` and accompanying meta-alg ([274](https://github.com/neuraloperator/neuraloperator/pull/274))
- Meta-algorithm implemented as `IncrementalFNOTrainer`, a subclass of the `Trainer`

Thanks to Robertboy18

Out-of-the-box mixed-precision training
The Trainer's `mixed_precision` parameter automatically handles mixed-precision using the new `torch.autocast` framework.

A new data module
Overview
We've refactored all data-associated functionality into `neuralop.data`. Datasets are now located at `neuralop.data.datasets` and transforms are located at `neuralop.data.transforms`. We've also updated the interfaces of our example datasets, including the option to download data from the new [NeuralOperator Zenodo Community](https://zenodo.org/communities/neuraloperator).

The Darcy-flow, Burger's, and Navier-Stokes datasets now all derive from a `PTDataset` template class, which updates all interfaces, adds a`download` option and connects to the Zenodo data source ([299](https://github.com/neuraloperator/neuraloperator/pull/299)).

Car-CFD
To showcase our geometric models, we've also added a dataset of simulations of airflow over 3d ShapeNet car models ([452](https://github.com/neuraloperator/neuraloperator/pull/452)), as well as examples for the FNOGNO and GINO models (`scripts/train_fnogno_carcfd.py`, `scripts/train_gino_carcfd.py`).

Testing and Documentation

This release, we expanded test coverage to 80%. To ensure users can get the most out of the library with minimal effort, we also significantly improved the documentation, simplifying the docstring, adding more user-guides and new examples.

The **Quickstart Guide** has been fully updated to provide a smooth, hands-on experience for new users, with clear instructions on training, saving, and loading models.

Other changes

Correct complex optimization
PyTorch's default `Adam` implementation currently handles complex parameters by viewing as a 2-tensor stack `(real_values, imaginary_values)`. This leads to an incorrect magnitude computation, which in turn affects the computation of momentum. Our implementation keeps parameters as real, and updates the `SpectralConv`'s choice of parameter tensors to ensure that parameters are registered as complex.

- Adds custom `AdamW` implementation ([420](https://github.com/neuraloperator/neuraloperator/pull/420))
- Ensures `SpectralConv` parameters are registered with complex values ([401](https://github.com/neuraloperator/neuraloperator/pull/401))

Misc. bug fixes

- Fixes numerical instability in `UnitGaussianNormalizer` ([330](https://github.com/neuraloperator/neuraloperator/pull/330))
- Fixes factorized tensor contraction in `SpectralConv` when `separable=True` ([389](https://github.com/neuraloperator/neuraloperator/pull/389))
- Fixed a bug in `MGPatchingDataProcessor.to(device)` that prevented proper device transfers. ([449](https://github.com/neuraloperator/neuraloperator/pull/449))
- Corrected the number of training examples printed out during training in the `Trainer`. ([380](https://github.com/neuraloperator/neuraloperator/pull/380))
- Addressed future deprecation for `torch.amp.autocast` by updating to the latest initialization. ([393](https://github.com/neuraloperator/neuraloperator/pull/393), [#407](https://github.com/neuraloperator/neuraloperator/pull/407))
- The `DefaultDataProcessor` was updated to fix normalization issues in `training` and `eval` modes. ([397](https://github.com/neuraloperator/neuraloperator/pull/397))
- The Lp loss now has more sensible arguments names and defaults ([486](https://github.com/neuraloperator/neuraloperator/pull/486))


Contributors
This release was the result of a large team effort, thank you to all those who contributed!
dhpitt JeanKossaifi zongyi-li kovachki bonevbs mliuschi Robertboy18 animakumar
We particularly thank dhpitt, who joined the team as part of the Schmidt Academy for Software Engineering and has done a huge amount of work on this release.

And welcome to our new contributors, helgehr, suyashbire1, zijieli-Jlee, plutonium-239, ehsanngh and white-alistair!


**Full Changelog**: https://github.com/neuraloperator/neuraloperator/compare/0.3.0...1.0.0

0.3.0

Summary

We are excited to release this new version of the neuraloperator library! It brings many improvements, including new architectures (SFNO, GNO, GINO), many improvements to existing ones, out-of-the-box super resolution, super-evaluation and incremental training.

All models can now be easily saved and loaded and we provide a lightweight trainer compatible with all our neuraloperators. Head to the [examples](https://neuraloperator.github.io/neuraloperator/dev/auto_examples/index.html) for some sample code, and to the [API](https://neuraloperator.github.io/neuraloperator/dev/modules/api.html) for a full documentation!

What's Changed

* Refactor MLP config by JeanKossaifi in https://github.com/neuraloperator/neuraloperator/pull/143
* Adds super-resolution to FNO by JeanKossaifi in https://github.com/neuraloperator/neuraloperator/pull/147
* Adds ADA_IN norm by JeanKossaifi in https://github.com/neuraloperator/neuraloperator/pull/148
* Adds SFNO by JeanKossaifi in https://github.com/neuraloperator/neuraloperator/pull/150
* Fix missing parameters output_scaling_factor by sleepyeye in https://github.com/neuraloperator/neuraloperator/pull/159
* Finodev by ashiq24 in https://github.com/neuraloperator/neuraloperator/pull/152
* quick_avoid by ashiq24 in https://github.com/neuraloperator/neuraloperator/pull/173
* Add low-precision to TFNO by crwhite14 in https://github.com/neuraloperator/neuraloperator/pull/172
* fix SFNO example by crwhite14 in https://github.com/neuraloperator/neuraloperator/pull/177
* fix comma in readme file by gegewen in https://github.com/neuraloperator/neuraloperator/pull/179
* Liftproj mod to mlp by btolooshams in https://github.com/neuraloperator/neuraloperator/pull/182
* MLP additional statement to check for scenario where n_layers=1 by btolooshams in https://github.com/neuraloperator/neuraloperator/pull/183
* marge the update on fno mlp help description by btolooshams in https://github.com/neuraloperator/neuraloperator/pull/191
* Update guide on Fourier neural operator by devzhk in https://github.com/neuraloperator/neuraloperator/pull/156
* Spectrum analysis of datasets. by Robertboy18 in https://github.com/neuraloperator/neuraloperator/pull/193
* adding flag option to only pad the last dim by btolooshams in https://github.com/neuraloperator/neuraloperator/pull/185
* Minor error in L602 in fno.py by ImanLiao in https://github.com/neuraloperator/neuraloperator/pull/194
* gino by kovachki in https://github.com/neuraloperator/neuraloperator/pull/195
* Fix mlp nonlinearity by ziqi-ma in https://github.com/neuraloperator/neuraloperator/pull/197
* Reformat `layers/` directory with `black` by m4e7 in https://github.com/neuraloperator/neuraloperator/pull/199
* Use lifting channels in FNO.lifting if it is passed by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/196
* removed dead lines in FNOGNO by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/203
* Reformat `datasets/` directory with `black` by m4e7 in https://github.com/neuraloperator/neuraloperator/pull/205
* docstring for FNOGNO by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/202
* Fix Python 3.6 f-string compatibility and condense documentation for FNO classes by m4e7 in https://github.com/neuraloperator/neuraloperator/pull/209
* Split `preactivation` from `FNOBlock.forward()` by m4e7 in https://github.com/neuraloperator/neuraloperator/pull/214
* Padding correction by ashiq24 in https://github.com/neuraloperator/neuraloperator/pull/218
* general trainer class for GINO and NO by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/215
* Padding correction by ashiq24 in https://github.com/neuraloperator/neuraloperator/pull/220
* fix example Trainer API calls by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/219
* Refactor rescaling in skips as transform in the Spectral Conv by JeanKossaifi in https://github.com/neuraloperator/neuraloperator/pull/217
* Further simplification + UNO fix by JeanKossaifi in https://github.com/neuraloperator/neuraloperator/pull/221
* Sht correction by ashiq24 in https://github.com/neuraloperator/neuraloperator/pull/222
* Fix loss signatures to build doc by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/224
* fix small bug in the WandB logger callback by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/232
* Adding 4D prediction only, no nested fno by gegewen in https://github.com/neuraloperator/neuraloperator/pull/225
* Revert 4D_FNO changes until they are properly tested by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/235
* Remove torch_scatter and torch_cluster from CI pipeline's dependencies by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/233
* Model checkpointing by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/234
* Updates to documentation and callback docstrings by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/237
* index dropout moduleList by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/239
* fix syntax error and add index.rst by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/240
* Fix typo in checkpoint init by rybchuk in https://github.com/neuraloperator/neuraloperator/pull/241
* Bug fixes and unit testing for Callbacks by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/242
* Refactors SpectralConv for simpler FNO by JeanKossaifi in https://github.com/neuraloperator/neuraloperator/pull/244
* BaseModel: adds checkpointing, versioning, safeguards by JeanKossaifi in https://github.com/neuraloperator/neuraloperator/pull/257
* Add Burger's dataset and PINO by crwhite14 in https://github.com/neuraloperator/neuraloperator/pull/256
* Enable transform wrappers by JeanKossaifi in https://github.com/neuraloperator/neuraloperator/pull/254
* Update tensor_dataset.py by slanthaler in https://github.com/neuraloperator/neuraloperator/pull/260
* Update to the checkpoint callback and test by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/258
* fix domain_padding to accept list (e.g., [0,0,1]) in addition to sc… by btolooshams in https://github.com/neuraloperator/neuraloperator/pull/263
* Move to DataProcessor API by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/262
* Fix navier stokes preprocessor bug by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/265
* Fixes to make `DataProcessor` code doc build by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/266
* Add AutoML via Optuna by crwhite14 in https://github.com/neuraloperator/neuraloperator/pull/243
* fixing the horizontal_skips_map construction, it was not going through by btolooshams in https://github.com/neuraloperator/neuraloperator/pull/267
* Updates to saving and loading models by dhpitt in https://github.com/neuraloperator/neuraloperator/pull/268

New Contributors
* sleepyeye made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/159
* crwhite14 made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/172
* gegewen made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/179
* btolooshams made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/182
* devzhk made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/156
* Robertboy18 made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/193
* ImanLiao made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/194
* kovachki made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/195
* ziqi-ma made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/197
* m4e7 made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/199
* dhpitt made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/196
* rybchuk made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/241
* slanthaler made their first contribution in https://github.com/neuraloperator/neuraloperator/pull/260

**Full Changelog**: https://github.com/neuraloperator/neuraloperator/compare/0.2.0...0.3.0

Links

Releases

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.