Add ResolutionInvariantReadout with FNO integration and gallery examples#6
Closed
JoshBeacom wants to merge 1 commit into
Closed
Add ResolutionInvariantReadout with FNO integration and gallery examples#6JoshBeacom wants to merge 1 commit into
JoshBeacom wants to merge 1 commit into
Conversation
- ResolutionInvariantReadout maps field outputs to scalar QoIs via spatial reduction (mean/integral) and a linear/MLP projection head - Integrated as optional readout parameter on FNO with in_channels validation; OTNO guards against readout use due to incompatible output shape - Two gallery examples: Darcy scalar QoI and 3-D Poisson-Boltzmann screened energy demonstrating resolution invariance
2d6cb90 to
1ff94b0
Compare
Owner
Author
|
Superseded by #7. The conflict resolution was restaged on |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
ResolutionInvariantReadoutand an optionalreadout=parameter onFNO, reconciled with the currentmainso it merges cleanly.ResolutionInvariantReadoutmaps field outputs to scalar/vector QoIs via spatial reduction (mean/integral) + a linear/MLP projection head (neuralop/models/readouts.py).readoutparameter onFNO, within_channels↔out_channelsvalidation and a guard againstcomplex_data=True.OTNOexplicitly rejectsreadout(itsforwardindexes a target mesh and returns(out_channels, n_target), incompatible with(B, C, *spatial)heads).Why this PR (conflict resolution)
The
resolution-invariant-readoutbranch could no longer be merged intomainaftermaingained the GroupNorm (norm_groups) and configurable FNO conv-bias-kernel (conv_bias_kernel) work. This branch now mergesmainin and resolves the conflict.The only conflict was in
neuralop/models/tests/test_otno.py: both sides appended a new top-level test immediately aftertest_otno_output_shape, so git could not order them. Resolved by keeping both — they are independent:test_otno_rejects_readout(this branch) — OTNO raisesValueErrorwhen areadoutis passedtest_otno_group_norm(main) — OTNO honors a customnorm_groupsneuralop/models/fno.pyandneuralop/models/otno.pyauto-merged cleanly:main'snorm_groups/conv_bias_kerneladditions and this branch'sreadoutparameter/validation/forward path occupy disjoint regions and all survive intact.Tests
Run locally (CPU, torch 2.11):
test_otno.py+test_fno_readout.py— 49 passedtest_fno.py(incl. main'sconv_bias_kerneltests) — 360 passed(Pre-existing unrelated warnings only:
rno.pydocstring escape,has_cudadeprecation.)