Skip to content

Add ResolutionInvariantReadout with FNO integration and gallery examples#6

Closed
JoshBeacom wants to merge 1 commit into
mainfrom
resolution-invariant-readout
Closed

Add ResolutionInvariantReadout with FNO integration and gallery examples#6
JoshBeacom wants to merge 1 commit into
mainfrom
resolution-invariant-readout

Conversation

@JoshBeacom

Copy link
Copy Markdown
Owner

Summary

Adds ResolutionInvariantReadout and an optional readout= parameter on FNO, reconciled with the current main so it merges cleanly.

  • ResolutionInvariantReadout maps field outputs to scalar/vector QoIs via spatial reduction (mean/integral) + a linear/MLP projection head (neuralop/models/readouts.py).
  • Integrated as an optional readout parameter on FNO, with in_channelsout_channels validation and a guard against complex_data=True. OTNO explicitly rejects readout (its forward indexes a target mesh and returns (out_channels, n_target), incompatible with (B, C, *spatial) heads).
  • Two gallery examples: Darcy scalar QoI and 3-D Poisson–Boltzmann screened energy (demonstrating resolution invariance).

Why this PR (conflict resolution)

The resolution-invariant-readout branch could no longer be merged into main after main gained the GroupNorm (norm_groups) and configurable FNO conv-bias-kernel (conv_bias_kernel) work. This branch now merges main in and resolves the conflict.

The only conflict was in neuralop/models/tests/test_otno.py: both sides appended a new top-level test immediately after test_otno_output_shape, so git could not order them. Resolved by keeping both — they are independent:

  • test_otno_rejects_readout (this branch) — OTNO raises ValueError when a readout is passed
  • test_otno_group_norm (main) — OTNO honors a custom norm_groups

neuralop/models/fno.py and neuralop/models/otno.py auto-merged cleanly: main's norm_groups/conv_bias_kernel additions and this branch's readout parameter/validation/forward path occupy disjoint regions and all survive intact.

Tests

Run locally (CPU, torch 2.11):

  • test_otno.py + test_fno_readout.py49 passed
  • test_fno.py (incl. main's conv_bias_kernel tests) — 360 passed

(Pre-existing unrelated warnings only: rno.py docstring escape, has_cuda deprecation.)

- 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
@JoshBeacom JoshBeacom force-pushed the resolution-invariant-readout branch from 2d6cb90 to 1ff94b0 Compare June 18, 2026 19:36
@JoshBeacom

Copy link
Copy Markdown
Owner Author

Superseded by #7. The conflict resolution was restaged on resolution-invariant-readout-merged for review without touching upstream neuraloperator#719 (which has been restored to its pre-fix state).

@JoshBeacom JoshBeacom closed this Jun 18, 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.

1 participant