neuralop.layers.normalization_layers
.InstanceNorm
- class neuralop.layers.normalization_layers.InstanceNorm(**kwargs)[source]
Dimension-agnostic instance normalization layer for neural operators.
InstanceNorm normalizes each sample in the batch independently, computing mean and variance across spatial dimensions for each sample and channel separately. This is useful when the statistical properties of each sample are distinct and should be treated separately.
- Parameters:
- **kwargsdict, optional
Additional parameters to pass to torch.nn.functional.instance_norm(). Common parameters include: - eps : float, optional
Small value added to the denominator for numerical stability. Default is 1e-5.
- momentumfloat, optional
Value used for the running_mean and running_var computation. Default is 0.1.
- use_input_statsbool, optional
If True, use input statistics. Default is True.
- weighttorch.Tensor, optional
Weight tensor for affine transformation. If None, no scaling applied.
- biastorch.Tensor, optional
Bias tensor for affine transformation. If None, no bias applied.
Methods
forward
(x)Apply instance normalization to the input tensor.
- forward(x)[source]
Apply instance normalization to the input tensor.