-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
71 additions
and
32,273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import matplotlib.pyplot as plt | ||
from neuralop.datasets import load_darcy_flow_small | ||
|
||
train_loader, test_loaders, data_processor = load_darcy_flow_small( | ||
n_train=100, batch_size=4, | ||
test_resolutions=[32, 32], n_tests=[50, 50], test_batch_sizes=[4, 2], | ||
) | ||
|
||
train_dataset = train_loader.dataset | ||
for res, test_loader in test_loaders.items(): | ||
print(res) | ||
# Get first batch | ||
batch = next(iter(test_loader)) | ||
x = batch['x'] | ||
y = batch['y'] | ||
|
||
print(f'Testing samples for res {res} have shape {x.shape[1:]}') | ||
|
||
|
||
data = train_dataset[0] | ||
x = data['x'] | ||
y = data['y'] | ||
|
||
print(f'Training sample have shape {x.shape[1:]}') | ||
|
||
|
||
# Which sample to view | ||
index = 0 | ||
|
||
data = train_dataset[index] | ||
data = data_processor.preprocess(data, batched=False) | ||
x = data['x'] | ||
y = data['y'] | ||
fig = plt.figure(figsize=(7, 7)) | ||
ax = fig.add_subplot(2, 2, 1) | ||
ax.imshow(x[0], cmap='gray') | ||
ax.set_title('input x') | ||
ax = fig.add_subplot(2, 2, 2) | ||
ax.imshow(y.squeeze()) | ||
ax.set_title('input y') | ||
ax = fig.add_subplot(2, 2, 3) | ||
ax.imshow(x[1]) | ||
ax.set_title('x: 1st pos embedding') | ||
ax = fig.add_subplot(2, 2, 4) | ||
ax.imshow(x[2]) | ||
ax.set_title('x: 2nd pos embedding') | ||
fig.suptitle('Visualizing one input sample', y=0.98) | ||
plt.tight_layout() | ||
fig.show() | ||
print() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
wandb | ||
ruamel.yaml | ||
configmypy | ||
tensorly | ||
tensorly-torch | ||
torch-harmonics | ||
matplotlib | ||
opt-einsum | ||
h5py | ||
zarr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.