Skip to content

Commit 6d1bca0

Browse files
Github action: auto-update.
1 parent 9b7705f commit 6d1bca0

File tree

154 files changed

+1372
-7249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+1372
-7249
lines changed
Binary file not shown.

dev/_downloads/082e73328a5caf8c1fe9ad7fe05cf68f/plot_incremental_FNO_darcy.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
"name": "python",
198198
"nbconvert_exporter": "python",
199199
"pygments_lexer": "ipython3",
200-
"version": "3.10.14"
200+
"version": "3.9.19"
201201
}
202202
},
203203
"nbformat": 4,

dev/_downloads/0ac9f102e4f1903984e3b4a7d517c88f/plot_darcy_flow.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"name": "python",
7979
"nbconvert_exporter": "python",
8080
"pygments_lexer": "ipython3",
81-
"version": "3.10.14"
81+
"version": "3.9.19"
8282
}
8383
},
8484
"nbformat": 4,
Binary file not shown.

dev/_downloads/1a3050d57a180b92b424ce128dfe1d36/plot_FNO_darcy.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
"""
2-
Training an FNO on Darcy-Flow
2+
Training a TFNO on Darcy-Flow
33
=============================
44
55
In this example, we demonstrate how to use the small Darcy-Flow example we ship with the package
6-
to train a Fourier-Neural Operator
6+
to train a Tensorized Fourier-Neural Operator
77
"""
88

99
# %%
1010
#
1111

12+
1213
import torch
1314
import matplotlib.pyplot as plt
1415
import sys
15-
from neuralop.models import FNO
16+
from neuralop.models import TFNO
1617
from neuralop import Trainer
1718
from neuralop.training import AdamW
1819
from neuralop.data.datasets import load_darcy_flow_small
@@ -33,13 +34,9 @@
3334

3435

3536
# %%
36-
# We create a simple FNO model
37+
# We create a tensorized FNO model
3738

38-
model = FNO(n_modes=(16, 16),
39-
in_channels=1,
40-
out_channels=1,
41-
hidden_channels=32,
42-
projection_channels=64)
39+
model = TFNO(n_modes=(16, 16), in_channels=1, hidden_channels=32, projection_channels=64, factorization='tucker', rank=0.42)
4340
model = model.to(device)
4441

4542
n_params = count_model_params(model)
Binary file not shown.

dev/_downloads/2a3ecbdce9fd535c53d44cc373f6a228/checkpoint_FNO_darcy.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,7 @@
3333
# %%
3434
# We create a tensorized FNO model
3535

36-
model = TFNO(n_modes=(16, 16),
37-
in_channels=1,
38-
out_channels=1,
39-
hidden_channels=32,
40-
projection_channels=64,
41-
factorization='tucker',
42-
rank=0.42)
43-
36+
model = TFNO(n_modes=(16, 16), in_channels=1, hidden_channels=32, projection_channels=64, factorization='tucker', rank=0.42)
4437
model = model.to(device)
4538

4639
n_params = count_model_params(model)
Binary file not shown.
Binary file not shown.

dev/_downloads/52640fe09fbb5b08e5a2370e57b3b066/checkpoint_FNO_darcy.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"outputs": [],
5353
"source": [
54-
"model = TFNO(n_modes=(16, 16),\n in_channels=1, \n out_channels=1, \n hidden_channels=32, \n projection_channels=64, \n factorization='tucker', \n rank=0.42)\n\nmodel = model.to(device)\n\nn_params = count_model_params(model)\nprint(f'\\nOur model has {n_params} parameters.')\nsys.stdout.flush()"
54+
"model = TFNO(n_modes=(16, 16), in_channels=1, hidden_channels=32, projection_channels=64, factorization='tucker', rank=0.42)\nmodel = model.to(device)\n\nn_params = count_model_params(model)\nprint(f'\\nOur model has {n_params} parameters.')\nsys.stdout.flush()"
5555
]
5656
},
5757
{
@@ -154,7 +154,7 @@
154154
"name": "python",
155155
"nbconvert_exporter": "python",
156156
"pygments_lexer": "ipython3",
157-
"version": "3.10.14"
157+
"version": "3.9.19"
158158
}
159159
},
160160
"nbformat": 4,
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/84c435865e4e2910253a980881498782/plot_count_flops.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"from copy import deepcopy\nimport torch\nfrom torchtnt.utils.flops import FlopTensorDispatchMode\n\nfrom neuralop.models import FNO\n\ndevice = 'cpu'\n\nfno = FNO(n_modes=(64,64), \n in_channels=1, \n out_channels=1, \n hidden_channels=64, \n projection_channels=64)\n\nbatch_size = 4\nmodel_input = torch.randn(batch_size, 1, 128, 128)\n\n\nwith FlopTensorDispatchMode(fno) as ftdm:\n # count forward flops\n res = fno(model_input).mean()\n fno_forward_flops = deepcopy(ftdm.flop_counts)\n \n ftdm.reset()\n res.backward()\n fno_backward_flops = deepcopy(ftdm.flop_counts)"
18+
"from copy import deepcopy\nimport torch\nfrom torchtnt.utils.flops import FlopTensorDispatchMode\n\nfrom neuralop.models import FNO\n\ndevice = 'cpu'\n\nfno = FNO(n_modes=(64,64), \n in_channels=3, \n out_channels=1, \n hidden_channels=64, \n projection_channels=64)\n\nbatch_size = 4\nmodel_input = torch.randn(batch_size, 3, 128, 128)\n\n\nwith FlopTensorDispatchMode(fno) as ftdm:\n # count forward flops\n res = fno(model_input).mean()\n fno_forward_flops = deepcopy(ftdm.flop_counts)\n \n ftdm.reset()\n res.backward()\n fno_backward_flops = deepcopy(ftdm.flop_counts)"
1919
]
2020
},
2121
{
@@ -71,7 +71,7 @@
7171
"name": "python",
7272
"nbconvert_exporter": "python",
7373
"pygments_lexer": "ipython3",
74-
"version": "3.10.14"
74+
"version": "3.9.19"
7575
}
7676
},
7777
"nbformat": 4,

dev/_downloads/969baa48c90c32befa7c7d2590c8ca42/darcy_data_processor.ipynb

Lines changed: 0 additions & 72 deletions
This file was deleted.

dev/_downloads/af3a515d2684655c6a5a8e0df87a4cf9/plot_SFNO_swe.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"outputs": [],
5353
"source": [
54-
"model = SFNO(n_modes=(32, 32),\n in_channels=3,\n out_channels=3,\n hidden_channels=32,\n projection_channels=64,\n factorization='dense')\nmodel = model.to(device)\n\nn_params = count_model_params(model)\nprint(f'\\nOur model has {n_params} parameters.')\nsys.stdout.flush()"
54+
"model = SFNO(n_modes=(32, 32), in_channels=3, out_channels=3, hidden_channels=32, projection_channels=64, factorization='dense')\nmodel = model.to(device)\n\nn_params = count_model_params(model)\nprint(f'\\nOur model has {n_params} parameters.')\nsys.stdout.flush()"
5555
]
5656
},
5757
{
@@ -172,7 +172,7 @@
172172
"name": "python",
173173
"nbconvert_exporter": "python",
174174
"pygments_lexer": "ipython3",
175-
"version": "3.10.14"
175+
"version": "3.9.19"
176176
}
177177
},
178178
"nbformat": 4,

dev/_downloads/b84984d89c00aa83f7c56c96a61b8aee/darcy_data_processor.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

dev/_downloads/be42c4c413e9b89016fa3a4984cb9758/plot_SFNO_swe.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@
3131
# %%
3232
# We create a tensorized FNO model
3333

34-
model = SFNO(n_modes=(32, 32),
35-
in_channels=3,
36-
out_channels=3,
37-
hidden_channels=32,
38-
projection_channels=64,
39-
factorization='dense')
34+
model = SFNO(n_modes=(32, 32), in_channels=3, out_channels=3, hidden_channels=32, projection_channels=64, factorization='dense')
4035
model = model.to(device)
4136

4237
n_params = count_model_params(model)

dev/_downloads/c628421a5214dc8f1b3bde8be930715f/plot_darcy_flow_spectrum.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"name": "python",
108108
"nbconvert_exporter": "python",
109109
"pygments_lexer": "ipython3",
110-
"version": "3.10.14"
110+
"version": "3.9.19"
111111
}
112112
},
113113
"nbformat": 4,
Binary file not shown.

dev/_downloads/de69282d3144c5a2b675c6f6338237c1/plot_count_flops.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
device = 'cpu'
2020

2121
fno = FNO(n_modes=(64,64),
22-
in_channels=1,
22+
in_channels=3,
2323
out_channels=1,
2424
hidden_channels=64,
2525
projection_channels=64)
2626

2727
batch_size = 4
28-
model_input = torch.randn(batch_size, 1, 128, 128)
28+
model_input = torch.randn(batch_size, 3, 128, 128)
2929

3030

3131
with FlopTensorDispatchMode(fno) as ftdm:

dev/_downloads/e81e8f640b2a3cda84c542bbc8f36a54/plot_FNO_darcy.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"\n# Training an FNO on Darcy-Flow\n\nIn this example, we demonstrate how to use the small Darcy-Flow example we ship with the package\nto train a Fourier-Neural Operator\n"
7+
"\n# Training a TFNO on Darcy-Flow\n\nIn this example, we demonstrate how to use the small Darcy-Flow example we ship with the package\nto train a Tensorized Fourier-Neural Operator\n"
88
]
99
},
1010
{
@@ -15,7 +15,7 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"import torch\nimport matplotlib.pyplot as plt\nimport sys\nfrom neuralop.models import FNO\nfrom neuralop import Trainer\nfrom neuralop.training import AdamW\nfrom neuralop.data.datasets import load_darcy_flow_small\nfrom neuralop.utils import count_model_params\nfrom neuralop import LpLoss, H1Loss\n\ndevice = 'cpu'"
18+
"import torch\nimport matplotlib.pyplot as plt\nimport sys\nfrom neuralop.models import TFNO\nfrom neuralop import Trainer\nfrom neuralop.training import AdamW\nfrom neuralop.data.datasets import load_darcy_flow_small\nfrom neuralop.utils import count_model_params\nfrom neuralop import LpLoss, H1Loss\n\ndevice = 'cpu'"
1919
]
2020
},
2121
{
@@ -40,7 +40,7 @@
4040
"cell_type": "markdown",
4141
"metadata": {},
4242
"source": [
43-
"We create a simple FNO model\n\n"
43+
"We create a tensorized FNO model\n\n"
4444
]
4545
},
4646
{
@@ -51,7 +51,7 @@
5151
},
5252
"outputs": [],
5353
"source": [
54-
"model = FNO(n_modes=(16, 16),\n in_channels=1, \n out_channels=1,\n hidden_channels=32, \n projection_channels=64)\nmodel = model.to(device)\n\nn_params = count_model_params(model)\nprint(f'\\nOur model has {n_params} parameters.')\nsys.stdout.flush()"
54+
"model = TFNO(n_modes=(16, 16), in_channels=1, hidden_channels=32, projection_channels=64, factorization='tucker', rank=0.42)\nmodel = model.to(device)\n\nn_params = count_model_params(model)\nprint(f'\\nOur model has {n_params} parameters.')\nsys.stdout.flush()"
5555
]
5656
},
5757
{
@@ -172,7 +172,7 @@
172172
"name": "python",
173173
"nbconvert_exporter": "python",
174174
"pygments_lexer": "ipython3",
175-
"version": "3.10.14"
175+
"version": "3.9.19"
176176
}
177177
},
178178
"nbformat": 4,

dev/_downloads/ecc34f03fb30bee651bda959149422c4/plot_UNO_darcy.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"outputs": [],
3535
"source": [
36-
"train_loader, test_loaders, data_processor = load_darcy_flow_small(\n n_train=1000, batch_size=32, \n test_resolutions=[16, 32], n_tests=[100, 50],\n test_batch_sizes=[32, 32],\n)\n\nmodel = UNO(in_channels=1, \n out_channels=1, \n hidden_channels=64, \n projection_channels=64,\n uno_out_channels=[32,64,64,64,32],\n uno_n_modes=[[16,16],[8,8],[8,8],[8,8],[16,16]],\n uno_scalings=[[1.0,1.0],[0.5,0.5],[1,1],[2,2],[1,1]],\n horizontal_skips_map=None,\n channel_mlp_skip=\"linear\",\n n_layers = 5,\n domain_padding=0.2)\n\nmodel = model.to(device)\n\nn_params = count_model_params(model)\nprint(f'\\nOur model has {n_params} parameters.')\nsys.stdout.flush()"
36+
"train_loader, test_loaders, data_processor = load_darcy_flow_small(\n n_train=1000, batch_size=32, \n test_resolutions=[16, 32], n_tests=[100, 50],\n test_batch_sizes=[32, 32],\n)\n\n\n\nmodel = UNO(in_channels=1, out_channels=1, hidden_channels=64, projection_channels=64,uno_out_channels = [32,64,64,64,32], \\\n uno_n_modes= [[16,16],[8,8],[8,8],[8,8],[16,16]], uno_scalings= [[1.0,1.0],[0.5,0.5],[1,1],[2,2],[1,1]],\\\n horizontal_skips_map = None, n_layers = 5, domain_padding = 0.2)\nmodel = model.to(device)\n\nn_params = count_model_params(model)\nprint(f'\\nOur model has {n_params} parameters.')\nsys.stdout.flush()"
3737
]
3838
},
3939
{
@@ -154,7 +154,7 @@
154154
"name": "python",
155155
"nbconvert_exporter": "python",
156156
"pygments_lexer": "ipython3",
157-
"version": "3.10.14"
157+
"version": "3.9.19"
158158
}
159159
},
160160
"nbformat": 4,

dev/_downloads/f9c1e50d48828a746410d5400feb61f7/plot_UNO_darcy.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,11 @@
3131
test_batch_sizes=[32, 32],
3232
)
3333

34-
model = UNO(in_channels=1,
35-
out_channels=1,
36-
hidden_channels=64,
37-
projection_channels=64,
38-
uno_out_channels=[32,64,64,64,32],
39-
uno_n_modes=[[16,16],[8,8],[8,8],[8,8],[16,16]],
40-
uno_scalings=[[1.0,1.0],[0.5,0.5],[1,1],[2,2],[1,1]],
41-
horizontal_skips_map=None,
42-
channel_mlp_skip="linear",
43-
n_layers = 5,
44-
domain_padding=0.2)
4534

35+
36+
model = UNO(in_channels=1, out_channels=1, hidden_channels=64, projection_channels=64,uno_out_channels = [32,64,64,64,32], \
37+
uno_n_modes= [[16,16],[8,8],[8,8],[8,8],[16,16]], uno_scalings= [[1.0,1.0],[0.5,0.5],[1,1],[2,2],[1,1]],\
38+
horizontal_skips_map = None, n_layers = 5, domain_padding = 0.2)
4639
model = model.to(device)
4740

4841
n_params = count_model_params(model)
-1.36 KB
Loading
-2.45 KB
Loading
-3.86 KB
Loading
-445 Bytes
Loading
-190 Bytes
Loading
-961 Bytes
Loading
-8.47 KB
Loading
0 Bytes
Loading
Loading
Loading
Loading

dev/_modules/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=a746c00c" />
1818
<link rel="stylesheet" type="text/css" href="../_static/tensorly_style.css?v=a02e9698" />
19-
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery.css?v=61a4c737" />
19+
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery.css?v=d2d258e8" />
2020
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery-binder.css?v=f4aeca0c" />
2121
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery-dataframe.css?v=2082cf3c" />
2222
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery-rendered-html.css?v=1277b6f3" />
@@ -115,7 +115,6 @@
115115
<h1>All modules for which code is available</h1>
116116
<ul><li><a href="neuralop/data/datasets/darcy.html">neuralop.data.datasets.darcy</a></li>
117117
<li><a href="neuralop/data/transforms/data_processors.html">neuralop.data.transforms.data_processors</a></li>
118-
<li><a href="neuralop/layers/embeddings.html">neuralop.layers.embeddings</a></li>
119118
<li><a href="neuralop/layers/integral_transform.html">neuralop.layers.integral_transform</a></li>
120119
<li><a href="neuralop/layers/neighbor_search.html">neuralop.layers.neighbor_search</a></li>
121120
<li><a href="neuralop/layers/padding.html">neuralop.layers.padding</a></li>

dev/_modules/neuralop/data/datasets/darcy.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css?v=a746c00c" />
1818
<link rel="stylesheet" type="text/css" href="../../../../_static/tensorly_style.css?v=a02e9698" />
19-
<link rel="stylesheet" type="text/css" href="../../../../_static/sg_gallery.css?v=61a4c737" />
19+
<link rel="stylesheet" type="text/css" href="../../../../_static/sg_gallery.css?v=d2d258e8" />
2020
<link rel="stylesheet" type="text/css" href="../../../../_static/sg_gallery-binder.css?v=f4aeca0c" />
2121
<link rel="stylesheet" type="text/css" href="../../../../_static/sg_gallery-dataframe.css?v=2082cf3c" />
2222
<link rel="stylesheet" type="text/css" href="../../../../_static/sg_gallery-rendered-html.css?v=1277b6f3" />

0 commit comments

Comments
 (0)