Skip to content

Tabular, time-series, scientific, and geometric deep learning · Molecular and scientific deep learning · SPE015 · Architecture

Fourier Neural Operator (FNO)

FNO learns operators between discretized fields using spectral convolutions, enabling reusable surrogates across families of PDE inputs.

Needs a data type CodeSplash doesn't load yet Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

Running this needs images, audio, video, graphs or another data type CodeSplash doesn't load yet.

Availability
Needs a data type CodeSplash doesn't load yet
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

FNO learns operators between discretized fields using spectral convolutions, enabling reusable surrogates across families of PDE inputs. Low-frequency Fourier modes provide global interactions efficiently on suitable grids.

Question / hypotheses

The operative question is whether the specified representation, symmetry, likelihood or physical constraint improves held-out behavior for this data domain. This is a learning framework, not a null-hypothesis test; losses, attention weights and predictive confidence are not statistical p-values.

Architecture / computational structure

Lift input fields to feature channels, alternate learned spectral mixing and pointwise linear paths with nonlinearities, then project to output fields. The spectral path transforms to Fourier space, mixes retained modes and transforms back.

Assumptions

FFT grids and boundary conventions matter; periodicity is not automatically appropriate for every PDE. Resolution transfer depends on the represented operator and data distribution. High-frequency behavior, shocks and geometry shifts may be poorly captured.

Formula / computational definition

vl+1(x)=σ(Wlvl(x)+F−1[Rl(k)F(vl)(k)](x))v_{l+1}(x)=\sigma(W_lv_l(x)+\mathcal F^{-1}[R_l(k)\mathcal F(v_l)(k)](x)), with learned pointwise map WlW_l and mode-specific channel matrices Rl(k)R_l(k) on selected frequencies.

Parameters and notation

Learned or estimated: Lifting/projection layers, pointwise channel matrices and complex spectral weights on retained modes.

Hyperparameters and effects: Retained mode count, channel width, layer count, grid resolution, padding/boundary treatment, normalization and loss. More modes preserve finer structure but increase parameters and sensitivity to discretization.

Fitting, fine-tuning, and adaptation

Train on distinct input-field/solution pairs with held-out functions and parameter regimes. Transfer compatible spectral blocks, adapting lifting/projection or higher layers with smaller rates; changing geometry or units may require broader retraining. Check source retention and physical constraints after adaptation, not just average field error.

How to use and calibrate

Define the independent evaluation unit before preprocessing: row/entity, whole set/object, molecule/trajectory, input function or chronological forecasting origin. Keep target construction and normalization within permitted training data. Evaluate relative field error, spectra, conservation/residual diagnostics, unseen resolutions and parameters, and end-to-end speed including data preparation. Compare with simple interpolation and classical solvers.

Example application

Emulate a PDE solution operator across many coefficient or forcing fields on a regular grid. This is a proposed use case, not a claim of validated performance on supplied real data.

Interpretation / pitfalls

Watch out

Assess model error against domain baselines and the stated assumptions. Component-level mathematical correctness does not establish paper reproduction or scientific validity. Use an independent validation design for model selection and a final held-out evaluation for claims; uncertainty and calibration require separate assessment.

Python and R code examples

Scope: A real spectral filtering path plus local residual path, illustrating one FNO layer. Use the shared setup. Dependencies: NumPy / base R. Validation: Python executed; R unexecuted.

Full-model route: Python: neuraloperator or custom FFT tensor layers. R: native torch FFT components where supported, or Python bridge. The paired base-array code demonstrates a spectral filter plus local path; it is one fixed operator layer, not trained FNO.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — A real spectral filtering path plus local residual path, illustrating one FNO layer. Use the shared setup.

Shared setup for this chapter
import numpy as np
def sm(x):
    x=np.asarray(x); e=np.exp(x-x.max(axis=-1,keepdims=True)); return e/e.sum(axis=-1,keepdims=True)
n=16; grid=np.arange(n)/n; x=np.sin(2*np.pi*grid)+.3*np.cos(6*np.pi*grid)
spectrum=np.fft.rfft(x); multiplier=np.zeros_like(spectrum); multiplier[:3]=[1.,.8,.4]
spectral=np.fft.irfft(multiplier*spectrum,n=n)
y=np.tanh(.1*x+spectral)
assert np.max(np.abs(y.imag if np.iscomplexobj(y) else np.zeros(n)))==0
print(y[:5])
R

Component demo, not a trained model — A real spectral filtering path plus local residual path, illustrating one FNO layer. Use the shared setup.

Shared setup for this chapter
sm <- function(x) {
  if(is.null(dim(x))) { e<-exp(x-max(x)); return(e/sum(e)) }
  t(apply(x,1,function(v) { e<-exp(v-max(v)); e/sum(e) }))
}
n<-16; grid<-(0:(n-1))/n; x<-sin(2*pi*grid)+.3*cos(6*pi*grid)
spectrum<-fft(x); multiplier<-rep(0,n); multiplier[c(1,2,3,n-1,n)]<-c(1,.8,.4,.4,.8)
spectral<-Re(fft(multiplier*spectrum,inverse=TRUE)/n)
y<-tanh(.1*x+spectral); print(y[1:5])

Sources

From the CodeSplash reference, entry SPE015.