Spectral Convolution#
- class SpectralConvBlock1D(input_numb_fields, output_numb_fields, n_modes)[source]#
Bases:
Module
PINA implementation of Spectral Convolution Block for one dimensional tensors.
The module computes the spectral convolution of the input with a linear kernel in the fourier space, and then it maps the input back to the physical space.
The block expects an input of size
[batch, input_numb_fields, N]
and returns an output of size[batch, output_numb_fields, N]
.- Parameters:
- forward(x)[source]#
Forward computation for Spectral Convolution.
- Parameters:
x (torch.Tensor) – The input tensor, expect of size
[batch, input_numb_fields, x]
.- Returns:
The output tensor obtained from the spectral convolution of size
[batch, output_numb_fields, x]
.- Return type:
- class SpectralConvBlock2D(input_numb_fields, output_numb_fields, n_modes)[source]#
Bases:
Module
PINA implementation of spectral convolution block for two dimensional tensors.
The module computes the spectral convolution of the input with a linear kernel in the fourier space, and then it maps the input back to the physical space.
The block expects an input of size
[batch, input_numb_fields, Nx, Ny]
and returns an output of size[batch, output_numb_fields, Nx, Ny]
.- Parameters:
- forward(x)[source]#
Forward computation for Spectral Convolution.
- Parameters:
x (torch.Tensor) – The input tensor, expect of size
[batch, input_numb_fields, x, y]
.- Returns:
The output tensor obtained from the spectral convolution of size
[batch, output_numb_fields, x, y]
.- Return type:
- class SpectralConvBlock3D(input_numb_fields, output_numb_fields, n_modes)[source]#
Bases:
Module
PINA implementation of spectral convolution block for three dimensional tensors.
The module computes the spectral convolution of the input with a linear kernel in the fourier space, and then it maps the input back to the physical space.
The block expects an input of size
[batch, input_numb_fields, Nx, Ny, Nz]
and returns an output of size[batch, output_numb_fields, Nx, Ny, Nz]
.- Parameters:
- forward(x)[source]#
Forward computation for Spectral Convolution.
- Parameters:
x (torch.Tensor) – The input tensor, expect of size
[batch, input_numb_fields, x, y, z]
.- Returns:
The output tensor obtained from the spectral convolution of size
[batch, output_numb_fields, x, y, z]
.- Return type: