Downloads · 30 days
0
jmtsh21/cross-attn-fno-model
cross-attn-fno-model is a machine learning model from jmtsh21. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This model implements a Cross-Attention Coefficient Head for the Fourier Neural Operator (FNO) architecture, designed to improve out-of-distribution (OOD) generalization when the coefficient field statistics shift.
Downloads · 30 days
0
Access
Public
Updated May 9, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md4.2 KB · 73%
From the Hugging Face model README
This model implements a Cross-Attention Coefficient Head for the Fourier Neural Operator (FNO) architecture, designed to improve out-of-distribution (OOD) generalization when the coefficient field statistics shift.
Standard FNO treats the variable coefficient field a(x) as just another input channel (concatenated). This model instead uses a cross-attention mechanism where:
[-1,1]²a(x)This forces the model to build a conditioning representation of the coefficient field rather than treating it as a fixed input feature, improving generalization when permeability statistics differ from training.
a(x) ──[kv_embed]──► KV
│
├──► cross-attn ◄── Q = query_proj(coordinate_grid [-1,1]²)
│
└──► bypass = coeff_bypass(a) ──┐
▼
attended + bypass ──[FNO blocks]──► projection ──► u(x)
| Parameter | Value |
|---|---|
| Resolution | 32×32 |
| Width | 32 |
| Depth | 3 FNO blocks |
| Modes | 8 |
| Attention Heads | 4 |
| Parameter | Value |
|---|---|
| Resolution | 64×64 |
| Width | 64 |
| Depth | 4 FNO blocks |
| Modes | 12 |
| Attention Heads | 4 |
-∇·(a(x)∇u) = 1 on unit square, zero Dirichlet BCsspsolve or numpy dense)| Split | Distribution | Baseline RL2 | Cross-Attn RL2 |
|---|---|---|---|
| ID | L=0.1 | ~0.018 | ~0.021 |
| OOD Smooth | L=0.2 | ~0.065 (3.5×) | ~0.029 (1.4×) |
| OOD Rough | L=0.05 | ~0.071 (3.9×) | ~0.032 (1.5×) |
Based on small-scale experiments at 32×32 resolution. Full 64×64 results pending.
If you use this model, please cite:
@article{calvello2024continuum,
title={Continuum Attention for Neural Operators},
author={Calvello, Edoardo and Boull\'e, Nicolas and Schäfer, Florian},
journal={arXiv preprint arXiv:2406.06486},
year={2024}
}
@article{li2021fno,
title={Fourier Neural Operator for Parametric Partial Differential Equations},
author={Li, Zongyi and Kovachki, Nikola and Azizzadenesheli, Kamyar and others},
journal={NeurIPS},
year={2021}
}