FourierLayer<T>
Layers · AiDotNet.PhysicsInformed.NeuralOperators
Represents a single Fourier layer in the FNO.
Inheritance: LayerBase<T> → FourierLayer<T>
Implements: IShapeContract
How It Works
For Beginners: This layer is the heart of the FNO. It performs:
- FFT: Convert to frequency domain
- Spectral convolution: Multiply by learned weights (in Fourier space)
- IFFT: Convert back to physical space
- Add local convolution (via 1x1 convolution)
- Apply activation function
Why This Works:
- In Fourier space, convolution becomes multiplication (very efficient!)
- We learn which frequencies are important
- Captures both global (low frequency) and local (high frequency) information
The spectral convolution is key: it’s a global operation that couples all spatial points, allowing the network to capture long-range dependencies.
Constructors
| Constructor | Summary |
|---|---|
FourierLayer(int width, int modes, int[] spatialDimensions, IActivationFunction<T> activation) |
Properties
| Property | Summary |
|---|---|
bool SupportsTraining { get; } |
Methods
| Method | Summary |
|---|---|
Dictionary<string, string> GetParameterRoles() |
Returns parameter roles for per-role optimizer configuration (e.g., weight decay exemption for biases). |
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
|
IReadOnlyList<Tensor<T>> GetTrainableParameters() |
Returns all trainable parameter tensors marked with [TrainableParameter]. |
void ClearGradients() |
|
void ResetState() |
|
void SetTrainableParameters(IReadOnlyList<Tensor<T>> parameters) |
Replaces trainable parameter tensors (e.g., with ParameterBuffer views). |
void UpdateParameters(T learningRate) |
Legacy scalar-learning-rate parameter update. |
void ZeroGrad() |
Clears all gradient fields discovered by convention ({paramName}Gradient). |