phlower.nn.FixedNorm¶
- class phlower.nn.FixedNorm(nodes=None, mean_name='mean', std_name='std')[source]¶
Bases:
IGenericPhlowerCoreModule[IPhlowerLayerParameters,PhlowerTensor],ModuleFixedNorm is a neural network module that applies normalization on the input tensor with fixed parameters.
- Parameters:
nodes (list[int]) – List of feature dimension sizes (The last value of tensor shape).
mean_name (str) – Name of the mean parameter for normalization.
std_name (str) – Name of the standard deviation parameter for normalization.
Examples
>>> fixed_norm = FixedNorm(mean_name="mean", std_name="std") >>> fixed_norm(data)
Methods
forward(data, *[, field_data])Define the computation performed at every call.
from_setting(setting)Generate FixedNorm from setting object
Return neural network name
Attributes
T_destinationcall_super_initdump_patchestraining- forward(data, *, field_data=None, **kwards)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.- Parameters:
data (IPhlowerTensorCollections)
field_data (ISimulationField | None)
- Return type:
PhlowerTensor