neuralop.models.GINO

class neuralop.models.GINO(in_channels, out_channels, latent_feature_channels=None, projection_channels=256, gno_coord_dim=3, gno_pos_embed_type='transformer', gno_embed_channels=32, gno_embed_max_positions=10000, gno_radius=0.033, in_gno_channel_mlp_hidden_layers=[80, 80, 80], out_gno_channel_mlp_hidden_layers=[512, 256], gno_channel_mlp_non_linearity=<built-in function gelu>, in_gno_transform_type='linear', out_gno_transform_type='linear', gno_use_open3d=False, gno_use_torch_scatter=True, out_gno_tanh=None, fno_in_channels=3, fno_n_modes=(16, 16, 16), fno_hidden_channels=64, lifting_channels=256, fno_n_layers=4, fno_resolution_scaling_factor=None, fno_incremental_n_modes=None, fno_block_precision='full', fno_use_channel_mlp=False, fno_channel_mlp_dropout=0, fno_channel_mlp_expansion=0.5, fno_non_linearity=<built-in function gelu>, fno_stabilizer=None, fno_norm=None, fno_ada_in_features=4, fno_ada_in_dim=1, fno_preactivation=False, fno_skip='linear', fno_channel_mlp_skip='soft-gating', fno_separable=False, fno_factorization=None, fno_rank=1.0, fno_joint_factorization=False, fno_fixed_rank_modes=False, fno_implementation='factorized', fno_decomposition_kwargs={}, fno_conv_module=<class 'neuralop.layers.spectral_convolution.SpectralConv'>, **kwargs)[source]

GINO: Geometry-informed Neural Operator. Learns a mapping between functions presented over arbitrary coordinate meshes. The model carries global integration through spectral convolution layers in an intermediate latent space, as described in [1]_.

Parameters:
in_channelsint

feature dimension of input points

out_channelsint

feature dimension of output points

latent_feature_channelsint, optional

number of channels in optional latent feature map to concatenate onto latent embeddings before the latent FNO’s forward pass, default None

projection_channelsint, optional

number of channels in FNO pointwise projection

gno_coord_dimint, optional

geometric dimension of input/output queries, by default 3

gno_pos_embed_typeliteral {‘transformer’, ‘nerf’} | None

type of optional sinusoidal positional embedding to use in GNOBlock, by default ‘transformer’

gno_embed_channels: int

dimension of optional per-channel embedding to use in GNOBlock, by default 32

gno_embed_max_positions: int

max positions of optional per-channel embedding to use in GNOBlock, by default 10000. If gno_pos_embed_type != ‘transformer’, value is unused.

gno_radiusfloat, optional

radius in input/output space for GNO neighbor search, by default 0.033

in_gno_channel_mlp_hidden_layerslist, optional

widths of hidden layers in input GNO, by default [80, 80, 80]

out_gno_channel_mlp_hidden_layerslist, optional

widths of hidden layers in output GNO, by default [512, 256]

gno_channel_mlp_non_linearitynn.Module, optional

nonlinearity to use in gno ChannelMLP, by default F.gelu

in_gno_transform_typestr, optional

transform type parameter for input GNO, by default ‘linear’ see neuralop.layers.IntegralTransform

out_gno_transform_typestr, optional

transform type parameter for output GNO, by default ‘linear’ see neuralop.layers.IntegralTransform

gno_use_open3dbool, optional

whether to use open3d neighbor search, by default False if False, uses pure-PyTorch fallback neighbor search

gno_use_torch_scatterbool, optional

whether to use torch_scatter’s neighborhood reduction function or the native PyTorch implementation in IntegralTransform layers. If False, uses the fallback PyTorch version.

out_gno_tanhbool, optional

whether to use tanh to stabilize outputs of the output GNO, by default False

fno_in_channelsint, optional

number of input channels for FNO, by default 26

fno_n_modestuple, optional

number of modes along each dimension to use in FNO, by default (16, 16, 16)

fno_hidden_channelsint, optional

hidden channels for use in FNO, by default 64

lifting_channelsint, optional

number of channels in FNO’s pointwise lifting, by default 256

fno_projection_channelsint, optional

number of channels in FNO’s pointwise projection, by default 256

fno_n_layersint, optional

number of layers in FNO, by default 4

fno_resolution_scaling_factorfloat | None, optional

factor by which to scale output of FNO, by default None

fno_incremental_n_modeslist[int] | None, defaults to None
if passed, sets n_modes separately for each FNO layer.
fno_block_precisionstr, defaults to ‘full’

data precision to compute within fno block

fno_use_channel_mlpbool, defaults to False

Whether to use a ChannelMLP layer after each FNO block.

fno_channel_mlp_dropoutfloat, defaults to 0

dropout parameter of above ChannelMLP.

fno_channel_mlp_expansionfloat, defaults to 0.5

expansion parameter of above ChannelMLP.

fno_non_linearitynn.Module, defaults to F.gelu

nonlinear activation function between each FNO layer.

fno_stabilizernn.Module | None, defaults to None

By default None, otherwise tanh is used before FFT in the FNO block.

fno_normnn.Module | None, defaults to None

normalization layer to use in FNO.

fno_ada_in_featuresint | None, defaults to 4

if an adaptive mesh is used, number of channels of its positional embedding. If None, adaptive mesh embedding is not used.

fno_ada_in_dimint, defaults to 1

dimensions of above FNO adaptive mesh.

fno_preactivationbool, defaults to False

whether to use Resnet-style preactivation.

fno_skipstr, defaults to ‘linear’

type of skip connection to use.

fno_channel_mlp_skipstr, defaults to ‘soft-gating’

type of skip connection to use in the FNO ‘linear’: conv layer ‘soft-gating’: weights the channels of the input ‘identity’: nn.Identity

fno_separablebool, defaults to False

if True, use a depthwise separable spectral convolution.

fno_factorizationstr {‘tucker’, ‘tt’, ‘cp’} | None, defaults to None

Tensor factorization of the parameters weight to use

fno_rankfloat, defaults to 1.0

Rank of the tensor factorization of the Fourier weights.

fno_joint_factorizationbool, defaults to False

Whether all the Fourier layers should be parameterized by a single tensor (vs one per layer).

fno_fixed_rank_modesbool, defaults to False

Modes to not factorize.

fno_implementationstr {‘factorized’, ‘reconstructed’} | None, defaults to ‘factorized’

If factorization is not None, forward mode to use:: * reconstructed : the full weight tensor is reconstructed from the factorization and used for the forward pass * factorized : the input is directly contracted with the factors of the decomposition

fno_decomposition_kwargsdict, defaults to dict()

Optionaly additional parameters to pass to the tensor decomposition.

fno_conv_modulenn.Module, defaults to SpectralConv

Spectral Convolution module to use.

Methods

forward(x, input_geom, latent_queries, ...)

The GINO's forward call: Input GNO --> FNOBlocks --> output GNO + projection to output queries

latent_embedding(in_p[, ada_in])

forward(x, input_geom, latent_queries, output_queries, latent_features=None, ada_in=None, **kwargs)[source]

The GINO’s forward call: Input GNO –> FNOBlocks –> output GNO + projection to output queries

Parameters:
xtorch.Tensor

input function a defined on the input domain input_geom shape (batch, n_in, in_channels)

input_geomtorch.Tensor

input domain coordinate mesh shape (1, n_in, gno_coord_dim)

latent_queriestorch.Tensor

latent geometry on which to compute FNO latent embeddings a grid on [0,1] x [0,1] x …. shape (1, n_gridpts_1, …. n_gridpts_n, gno_coord_dim)

output_queriestorch.Tensor

points at which to query the final GNO layer to get output shape (batch, n_out, gno_coord_dim)

latent_featurestorch.Tensor, optional

optional feature map to concatenate onto latent embedding before being passed into the latent FNO, default None if latent_feature_channels is set, must be passed

ada_intorch.Tensor, optional

adaptive scalar instance parameter, defaults to None