Skip to content

Add geometry handling using GNO#34

Closed
aprokop wants to merge 8 commits intoORNL:mainfrom
aprokop:gno
Closed

Add geometry handling using GNO#34
aprokop wants to merge 8 commits intoORNL:mainfrom
aprokop:gno

Conversation

@aprokop
Copy link
Copy Markdown
Collaborator

@aprokop aprokop commented Feb 17, 2026

No description provided.

@aprokop aprokop marked this pull request as ready for review February 19, 2026 20:17
@aprokop aprokop requested a review from pzhanggit February 19, 2026 20:19
Copy link
Copy Markdown
Collaborator

@pzhanggit pzhanggit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments. The PR will require more rounds of reviews. One major comment is to move the gno as part of the embedding and debedding as we discussed earlier this week.

if len(variables) == 3:
if len(variables) >= 3:
ret_dict["cond_fields"] = variables[2]
if len(variables) >= 4:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does geometry always show up together with cond_fields?

Comment on lines +302 to +304
indices_x = slice(6, 54)
indices_y = slice(1, 49)
indices_z = slice(1, 49)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are those hard-coded numbers?

else:
dictcase[datacasedir]["stats"] = self.compute_and_save_stats(f, json_path)

nx = [50, 192, 50]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we use self.cubsizes?

tx = np.linspace(0, nx[0], res[0], dtype=np.float32)
ty = np.linspace(0, nx[1], res[1], dtype=np.float32)
tz = np.linspace(0, nx[2], res[2], dtype=np.float32)
self.geometry = np.stack(np.meshgrid(tx, ty, tz, indexing="ij"), axis=-1)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the variable self.geometry represent? It seems it will be combined with indices to point out the solid objects location?

from .models.avit import build_avit
from .models.svit import build_svit
from .models.vit import build_vit
from .models.gno import build_gno
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would build_gno support a stand-alonegino model? If not, I suggest not to put it together with other models. Maybe treat it more like a utils function? OR rename it to something likeadd_gno`?

cond_input = None

if "geometry" in data:
geometry = data["geometry"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not on this PR, but now I wonder if we should simply keep the data dictionary objects unwrapped...

def __init__(self, inner_model, params=None):
super().__init__()

num_channels = params.gno["n_channels"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example config file for gno is missing?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, I suggest we set some default values for those variables

# reduction=params.gno.reduction
)

self.model = inner_model
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm repeated line

Comment on lines +218 to +220
bmin = [0, 0, 0]
bmax = [1, 1, 1]
self.latent_geom = self.generate_geometry(bmin, bmax, self.res)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either make them configurable or hard-coded in generate_geometry

Comment on lines +267 to +269
out = torch.zeros(B, C, D, H, W, device=x.device)
out_model = rearrange(out, 'b c d h w -> b (h w d) c')
out = rearrange(out, 'b c d h w -> b (h w d) c')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confusing lines - why don't you define it as b (h w d) c?

@aprokop
Copy link
Copy Markdown
Collaborator Author

aprokop commented Feb 25, 2026

Closing in favor of #37.

@aprokop aprokop closed this Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants