A Package that provides Layers for the learning of (nonlinear) operators in order to solve parametric PDEs.
For now, this package contains the Fourier Neural Operator originally proposed by Li et al.
I decided to implement this method in Julia because coding up a layer using PyTorch in Python is rather cumbersome in comparison and Julia as a whole simply runs at comparable or faster speed than Python. Please do check out the original work at GitHub as well.
The implementation of the layers is influenced heavily by the basic layers provided in the Flux.jl package.
Simply install by running in a REPL:
pkg> add OperatorLearning
The basic workflow is more or less in line with the layer architectures that Flux
provides, i.e. you construct individual layers, chain them if desired and pass the inputs as arguments to the layers.
The Fourier Layer performs a linear transform as well as convolution (linear transform in fourier space), adds them and passes it through the activation. Additionally, higher Fourier modes are filtered out in the convolution path where you can specify the amount of modes to be kept.
The syntax for a single Fourier Layer is:
using OperatorLearning
using Flux
# Input = 101, Output = 101, Batch size = 200, Grid points = 100, Fourier modes = 16
# Activation: sigmoid (you need to import Flux in your Script to access the activations)
model = FourierLayer(101, 101, 200, 100, 16, σ)
# Same as above, but perform strict convolution in Fourier Space
model = FourierLayer(101, 101, 200, 100, 16, σ; bias_fourier=false)
To see a full implementation, check the Burgers equation example at examples/burgers.jl
.
- 1D Fourier Layer
- 2D / 3D Fourier Layer
- DeepONet
- Physics informed Loss
Contributions are always welcome!
- Li et al., 2020 arXiv:2010.08895