Skip to content

FNO Models API

deepuq.models.fno

Fourier Neural Operator components for regular-grid field surrogates.

The 2D and 3D variants in this module accept channels-last field tensors and end with a pointwise nn.Linear head so they remain compatible with the package's last-layer Laplace workflow.

FNO2D

Bases: Module

A compact 2D Fourier Neural Operator for scalar field-to-field maps.

The public forward expects a tensor with shape [batch, nx, ny, C] and returns a scalar field with shape [batch, nx, ny].

forward

forward(x: Tensor) -> torch.Tensor

Map input fields on a 2D lattice to a scalar output field.

FNO3D

Bases: Module

A compact 3D Fourier Neural Operator for scalar field-to-field maps.

The public forward expects a tensor with shape [batch, nx, ny, nz, C] and returns a scalar volume with shape [batch, nx, ny, nz].

FNOBlock2D

Bases: Module

One 2D FNO block with spectral mixing and a local 1x1 skip path.

FNOBlock3D

Bases: Module

One 3D FNO block with spectral mixing and a local 1x1 skip path.

SpectralConv2D

Bases: Module

2D spectral convolution with truncated Fourier modes.

Parameters:

Name Type Description Default
in_channels int

Number of incoming feature channels.

required
out_channels int

Number of output feature channels.

required
modes Sequence[int]

Truncated low-frequency mode counts (mx, my) retained along the two spatial axes.

required

SpectralConv3D

Bases: Module

3D spectral convolution with truncated Fourier modes.

The layer follows the standard FNO pattern: transform to Fourier space, multiply a small set of learnable low-frequency modes, and transform back.