Skip to content
This repository was archived by the owner on Sep 28, 2024. It is now read-only.

Commit 7b87328

Browse files
committed
refactor readme
1 parent 1ff1a5d commit 7b87328

File tree

2 files changed

+69
-6
lines changed

2 files changed

+69
-6
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
[codecov badge]: https://codecov.io/gh/foldfelis/NeuralOperators.jl/branch/master/graph/badge.svg?token=JQH3MP1Y9R
1313
[codecov link]: https://codecov.io/gh/foldfelis/NeuralOperators.jl
1414

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.
15+
Neural operator is a novel deep learning architecture.
16+
It learns a operator, which is a mapping between infinite-dimensional function spaces.
17+
It can be used to resolve [partial differential equations (PDE)](https://en.wikipedia.org/wiki/Partial_differential_equation).
18+
Instead of solving by finite element method, a PDE problem can be resolved by training a neural network to learn an operator mapping
19+
from infinite-dimensional space (u, t) to infinite-dimensional space f(u, t).
20+
Neural operator learns a continuous function between two continuous function spaces.
21+
The kernel can be trained on different geometry, which is learned from a graph.
2022

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.
23+
Fourier neural operator learns a neural operator with Dirichlet kernel to form a Fourier transformation.
24+
It performs Fourier transformation across infinite-dimensional function spaces and learns better than neural operator.
2225

2326
Currently, the `FourierOperator` layer is provided in this work.
2427
As for model, there are `FourierNeuralOperator` and `MarkovNeuralOperator` provided. Please take a glance at them [here](src/model.jl).
@@ -106,3 +109,4 @@ julia> using FlowOverCircle; FlowOverCircle.train()
106109
- [zongyi-li/fourier_neural_operator](https://github.com/zongyi-li/fourier_neural_operator)
107110
- [Neural Operator: Graph Kernel Network for Partial Differential Equations](https://arxiv.org/abs/2003.03485)
108111
- [zongyi-li/graph-pde](https://github.com/zongyi-li/graph-pde)
112+
- [[Markov Neural Operators for Learning Chaotic Systems](https://arxiv.org/abs/2106.06898)]

docs/src/index.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,62 @@ Documentation for [NeuralOperators](https://github.com/foldfelis/NeuralOperators
1313
The demonstration showing above is Navier-Stokes equation learned by the `MarkovNeuralOperator` with only one time step information.
1414
Example can be found in [`example/FlowOverCircle`](https://github.com/foldfelis/NeuralOperators.jl/tree/master/example/FlowOverCircle).
1515
The result is also provided [here](assets/notebook/mno.jl.html)
16+
17+
Neural operator is a novel deep learning architecture.
18+
It learns a operator, which is a mapping between infinite-dimensional function spaces.
19+
It can be used to resolve [partial differential equations (PDE)](https://en.wikipedia.org/wiki/Partial_differential_equation).
20+
Instead of solving by finite element method, a PDE problem can be resolved by training a neural network to learn an operator mapping
21+
from infinite-dimensional space (u, t) to infinite-dimensional space f(u, t).
22+
Neural operator learns a continuous function between two continuous function spaces.
23+
The kernel can be trained on different geometry, which is learned from a graph.
24+
25+
Fourier neural operator learns a neural operator with Dirichlet kernel to form a Fourier transformation.
26+
It performs Fourier transformation across infinite-dimensional function spaces and learns better than neural operator.
27+
28+
Currently, the `FourierOperator` layer is provided in this work.
29+
As for model, there are `FourierNeuralOperator` and `MarkovNeuralOperator` provided.
30+
Please take a glance at them [here](https://github.com/foldfelis/NeuralOperators.jl/blob/master/src/model.jl).
31+
32+
## Quick start
33+
34+
The package can be installed with the Julia package manager. From the Julia REPL, type `]` to enter the Pkg REPL mode and run:
35+
36+
```julia-repl
37+
pkg> add NeuralOperators
38+
```
39+
40+
## Usage
41+
42+
```julia
43+
model = Chain(
44+
# project finite-dimensional data to infinite-dimensional space
45+
Dense(2, 64),
46+
# operator projects data between infinite-dimensional spaces
47+
FourierOperator(64=>64, (16, ), gelu),
48+
FourierOperator(64=>64, (16, ), gelu),
49+
FourierOperator(64=>64, (16, ), gelu),
50+
FourierOperator(64=>64, (16, )),
51+
# project infinite-dimensional function to finite-dimensional space
52+
Dense(64, 128, gelu),
53+
Dense(128, 1),
54+
flatten
55+
)
56+
```
57+
58+
Or you can just call:
59+
60+
```julia
61+
model = FourierNeuralOperator(
62+
ch=(2, 64, 64, 64, 64, 64, 128, 1),
63+
modes=(16, ),
64+
σ=gelu
65+
)
66+
```
67+
68+
And then train as a Flux model.
69+
70+
```julia
71+
loss(𝐱, 𝐲) = sum(abs2, 𝐲 .- model(𝐱)) / size(𝐱)[end]
72+
opt = Flux.Optimiser(WeightDecay(1f-4), Flux.ADAM(1f-3))
73+
Flux.@epochs 50 Flux.train!(loss, params(model), data, opt)
74+
```

0 commit comments

Comments
 (0)