Skip to content

Commit ba09e49

Browse files
Github action: auto-update.
1 parent 02c0083 commit ba09e49

File tree

54 files changed

+1523
-240
lines changed

Some content is hidden

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

54 files changed

+1523
-240
lines changed

dev/_downloads/01111202d22a556abc06831baa4765ac/plot_darcy_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
# The first step of the default FNO model is a grid-based
5757
# positional embedding. We will add it manually here to
5858
# visualize the channels appended by this embedding.
59-
positional_embedding = GridEmbedding2D()
59+
positional_embedding = GridEmbedding2D(in_channels=1)
6060
# at train time, data will be collated with a batch dim.
6161
# we create a batch dim to pass into the embedding, then re-squeeze
6262
x = positional_embedding(data['x'].unsqueeze(0)).squeeze(0)
Binary file not shown.

dev/_downloads/0ac9f102e4f1903984e3b4a7d517c88f/plot_darcy_flow.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
},
5959
"outputs": [],
6060
"source": [
61-
"for res, test_loader in test_loaders.items():\n print(res)\n # Get first batch\n batch = next(iter(test_loader))\n x = batch['x']\n y = batch['y']\n\n print(f'Testing samples for res {res} have shape {x.shape[1:]}')\n\n\ndata = train_dataset[0]\nx = data['x']\ny = data['y']\n\nprint(f'Training samples have shape {x.shape[1:]}')\n\n\n# Which sample to view\nindex = 0\n\ndata = train_dataset[index]\ndata = data_processor.preprocess(data, batched=False)\n\n# The first step of the default FNO model is a grid-based\n# positional embedding. We will add it manually here to\n# visualize the channels appended by this embedding.\npositional_embedding = GridEmbedding2D()\n# at train time, data will be collated with a batch dim.\n# we create a batch dim to pass into the embedding, then re-squeeze\nx = positional_embedding(data['x'].unsqueeze(0)).squeeze(0)\ny = data['y']\nfig = plt.figure(figsize=(7, 7))\nax = fig.add_subplot(2, 2, 1)\nax.imshow(x[0], cmap='gray')\nax.set_title('input x')\nax = fig.add_subplot(2, 2, 2)\nax.imshow(y.squeeze())\nax.set_title('input y')\nax = fig.add_subplot(2, 2, 3)\nax.imshow(x[1])\nax.set_title('x: 1st pos embedding')\nax = fig.add_subplot(2, 2, 4)\nax.imshow(x[2])\nax.set_title('x: 2nd pos embedding')\nfig.suptitle('Visualizing one input sample', y=0.98)\nplt.tight_layout()\nfig.show()"
61+
"for res, test_loader in test_loaders.items():\n print(res)\n # Get first batch\n batch = next(iter(test_loader))\n x = batch['x']\n y = batch['y']\n\n print(f'Testing samples for res {res} have shape {x.shape[1:]}')\n\n\ndata = train_dataset[0]\nx = data['x']\ny = data['y']\n\nprint(f'Training samples have shape {x.shape[1:]}')\n\n\n# Which sample to view\nindex = 0\n\ndata = train_dataset[index]\ndata = data_processor.preprocess(data, batched=False)\n\n# The first step of the default FNO model is a grid-based\n# positional embedding. We will add it manually here to\n# visualize the channels appended by this embedding.\npositional_embedding = GridEmbedding2D(in_channels=1)\n# at train time, data will be collated with a batch dim.\n# we create a batch dim to pass into the embedding, then re-squeeze\nx = positional_embedding(data['x'].unsqueeze(0)).squeeze(0)\ny = data['y']\nfig = plt.figure(figsize=(7, 7))\nax = fig.add_subplot(2, 2, 1)\nax.imshow(x[0], cmap='gray')\nax.set_title('input x')\nax = fig.add_subplot(2, 2, 2)\nax.imshow(y.squeeze())\nax.set_title('input y')\nax = fig.add_subplot(2, 2, 3)\nax.imshow(x[1])\nax.set_title('x: 1st pos embedding')\nax = fig.add_subplot(2, 2, 4)\nax.imshow(x[2])\nax.set_title('x: 2nd pos embedding')\nfig.suptitle('Visualizing one input sample', y=0.98)\nplt.tight_layout()\nfig.show()"
6262
]
6363
}
6464
],
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)