Skip to content

Commit 9685c19

Browse files
committed
update script to use XLB logo
1 parent b7661e9 commit 9685c19

2 files changed

Lines changed: 3 additions & 252 deletions

File tree

examples/cfd/differentiable_lbm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
from xlb.operator.macroscopic import Macroscopic
5050
import xlb.velocity_set
5151

52-
# For loading NVIDIA logo
52+
# For loading XLB logo
5353
try:
5454
from PIL import Image
5555
PIL_AVAILABLE = True
@@ -75,7 +75,7 @@ def __init__(
7575
target_shape='n_letter',
7676
learning_rate=1.0,
7777
target_coverage=0.5, # Fraction of grid covered by target pattern
78-
target_image_path=None, # Path to custom target image (e.g., NVIDIA logo)
78+
target_image_path=None, # Path to custom target image (e.g., XLB logo)
7979
):
8080
self.grid_shape = grid_shape
8181
self.Re = Re
@@ -290,6 +290,7 @@ def _load_target_image(self, image_path):
290290
# Convert to grayscale and normalize to [0, 1]
291291
img_gray = img_resized.convert('L')
292292
target = np.array(img_gray, dtype=np.float32) / 255.0
293+
target = np.flipud(target) # Flip vertically to match plot orientation
293294
target = target.T # Transpose to (nx, ny)
294295
print(f" Loaded target image: {image_path}")
295296
return target

examples/cfd/test_stepper_autodiff.py

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

0 commit comments

Comments
 (0)