|
1 | 1 | # NeuralOperators
|
2 | 2 |
|
3 |
| -## Source code status |
4 |
| - |
5 | 3 | | **Documentation** | **Build Status** |
|
6 | 4 | |:-----------------:|:----------------:|
|
7 | 5 | | [![doc dev badge]][doc dev link] | [![ci badge]][ci link] [![codecov badge]][codecov link] |
|
|
14 | 12 | [codecov badge]: https://codecov.io/gh/foldfelis/NeuralOperators.jl/branch/master/graph/badge.svg?token=JQH3MP1Y9R
|
15 | 13 | [codecov link]: https://codecov.io/gh/foldfelis/NeuralOperators.jl
|
16 | 14 |
|
17 |
| -[Neural Operator](https://github.com/zongyi-li/graph-pde) is a novel deep learning method to learned the mapping |
18 |
| -between infinite-dimensional spaces of functions introduced by [Zongyi Li](https://github.com/zongyi-li) et al. |
| 15 | +Neural operator is a novel deep learning architecture. It learns a operator, which is a mapping |
| 16 | +between infinite-dimensional function spaces. It can be used to resolve [partial differential equations (PDE)](https://en.wikipedia.org/wiki/Partial_differential_equation). |
| 17 | +Instead of solving by finite element method, a PDE problem can be resolved by learning a neural network to learn an operator |
| 18 | +mapping from infinite-dimensional space (u, t) to infinite-dimensional space f(u, t). Neural operator learns a continuous function |
| 19 | +between two continuous function spaces. The kernel can be trained on different geometry, which is learned from a graph. |
| 20 | + |
| 21 | +Fourier neural operator learns a neural operator with Dirichlet kernel to form a Fourier transformation. It performs Fourier transformation across infinite-dimensional function spaces and learns better than neural operator. |
| 22 | + |
| 23 | +Currently, `FourierOperator` is provided in this work. |
| 24 | + |
| 25 | +## Usage |
| 26 | + |
| 27 | +``` |
| 28 | +function FourierNeuralOperator() |
| 29 | + modes = (16, ) |
| 30 | + ch = 64 => 64 |
| 31 | + σ = gelu |
| 32 | +
|
| 33 | + return Chain( |
| 34 | + # project finite-dimensional data to infinite-dimensional space |
| 35 | + Dense(2, 64), |
| 36 | + # operator projects data between infinite-dimensional spaces |
| 37 | + FourierOperator(ch, modes, σ), |
| 38 | + FourierOperator(ch, modes, σ), |
| 39 | + FourierOperator(ch, modes, σ), |
| 40 | + FourierOperator(ch, modes), |
| 41 | + # project infinite-dimensional function to finite-dimensional space |
| 42 | + Dense(64, 128, σ), |
| 43 | + Dense(128, 1), |
| 44 | + flatten |
| 45 | + ) |
| 46 | +end |
| 47 | +``` |
| 48 | + |
| 49 | +Or you can just call: |
| 50 | + |
| 51 | +``` |
| 52 | +fno = FourierNeuralOperator() |
| 53 | +``` |
| 54 | + |
| 55 | +And then train as a Flux model. |
| 56 | + |
| 57 | +``` |
| 58 | +loss(𝐱, 𝐲) = sum(abs2, 𝐲 .- fno(𝐱)) / size(𝐱)[end] |
| 59 | +opt = Flux.Optimiser(WeightDecay(1f-4), Flux.ADAM(1f-3)) |
| 60 | +Flux.@epochs 50 Flux.train!(loss, params(m), data, opt) |
| 61 | +``` |
| 62 | + |
| 63 | +## Examples |
| 64 | + |
| 65 | +PDE training examples are provided in `example` folder. |
| 66 | + |
| 67 | +### One-dimensional Burgers' equation |
| 68 | + |
| 69 | +[Burgers' equation](https://en.wikipedia.org/wiki/Burgers%27_equation) example can be found in `example/burgers.jl`. |
| 70 | + |
| 71 | +### Two-dimensional Darcy flow equation |
| 72 | + |
| 73 | +WIP |
| 74 | + |
| 75 | +### Two-dimensional Navier-Stokes equation |
| 76 | + |
| 77 | +WIP |
| 78 | + |
| 79 | +## Roadmap |
| 80 | + |
| 81 | +- [x] `FourierOperator` layer |
| 82 | +- [x] One-dimensional Burgers' equation example |
| 83 | +- [ ] Two-dimensional Darcy flow equation example |
| 84 | +- [ ] Two-dimensional Navier-Stokes equation example |
| 85 | +- [ ] `NeuralOperator` layer |
| 86 | +- [ ] Poisson equation example |
| 87 | + |
| 88 | +## References |
19 | 89 |
|
20 |
| -In this project I temporarily provide the SpectralConv layer and the |
21 |
| -[Fourier Neural Operator](https://github.com/zongyi-li/fourier_neural_operator). |
22 |
| -For more information, please take a look at the |
23 |
| -[Fourier Neural Operator model](src/model.jl) and the [example](example/burgers.jl) of solving |
24 |
| -[Burgers' equation](https://www.wikiwand.com/en/Burgers%27_equation) |
| 90 | +- [Fourier Neural Operator for Parametric Partial Differential Equations](https://arxiv.org/abs/2010.08895) |
| 91 | + - [zongyi-li/fourier_neural_operator](https://github.com/zongyi-li/fourier_neural_operator) |
| 92 | +- [Neural Operator: Graph Kernel Network for Partial Differential Equations](https://arxiv.org/abs/2003.03485) |
| 93 | + - [zongyi-li/graph-pde](https://github.com/zongyi-li/graph-pde) |
0 commit comments