Skip to content

Fix FNO inverse pipeline for InitialConditionInterp with multi-step inputs#101

Open
Mattia-PCS wants to merge 1 commit into
pdebench:mainfrom
Mattia-PCS:fix/fno-inverse-multistep
Open

Fix FNO inverse pipeline for InitialConditionInterp with multi-step inputs#101
Mattia-PCS wants to merge 1 commit into
pdebench:mainfrom
Mattia-PCS:fix/fno-inverse-multistep

Conversation

@Mattia-PCS

Copy link
Copy Markdown

Summary

This PR fixes the FNO inverse pipeline when using InitialConditionInterp with initial_step > 1.

Two related issues were identified:

  1. The FNO branch did not initialize inverse_loader, preventing correct model initialization.
  2. InitialConditionInterp reconstructed only a single initial time slice, while FNO checkpoints trained with initial_step > 1 expect the full initial temporal window.

Changes

  • initialize inverse_loader in the FNO branch
  • reconstruct the complete initial temporal window for FNO
  • flatten the temporal window before calling the FNO model
  • keep inverse metrics consistent with the flattened representation

Validation

The original code raises:

UnboundLocalError

After fixing the loader initialization, the next failure is:

RuntimeError: mat1 and mat2 shapes cannot be multiplied (64x4 and 16x20)

With this patch, the same command completes successfully:

loss=0.8711221814155579 ... 100%|...| 20/20

The resulting input matches the FNO forward pipeline:

u0 before flatten: (1, 64, 5, 3)
u0_for_model:      (1, 64, 15)
grid:              (1, 64, 1)
fc0.in_features:   16

Fixes #ISSUE_NUMBER

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