phlower.nn.FixedNorm

class phlower.nn.FixedNorm(nodes=None, mean_name='mean', std_name='std')[source]

Bases: IGenericPhlowerCoreModule[IPhlowerLayerParameters, PhlowerTensor], Module

FixedNorm 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

get_nn_name()

Return neural network name

Attributes

T_destination

call_super_init

dump_patches

training

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 Module instance 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

classmethod from_setting(setting)[source]

Generate FixedNorm from setting object

Parameters:

setting (FixedNormSetting) – setting object

Returns:

FixedNorm object

Return type:

Self

classmethod get_nn_name()[source]

Return neural network name

Returns:

name

Return type:

str