pub struct INormalizationLayer { /* private fields */ }Expand description
INormalizationLayer
A normalization layer in a network definition.
The normalization layer performs the following operation:
X - input Tensor Y - output Tensor S - scale Tensor B - bias Tensor
Y = (X - Mean(X, axes)) / Sqrt(Variance(X) + epsilon) * S + B
Where Mean(X, axes) is a reduction over a set of axes, and Variance(X) = Mean((X - Mean(X, axes)) ^ 2, axes).
Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.
Implementations§
Source§impl INormalizationLayer
impl INormalizationLayer
Sourcepub fn setEpsilon(self: Pin<&mut INormalizationLayer>, eps: f32)
pub fn setEpsilon(self: Pin<&mut INormalizationLayer>, eps: f32)
Set the epsilon value used for the normalization calculation.
The default value of eps is 1e-5F.
epsThe epsilon value used for the normalization calculation.
Sourcepub fn getEpsilon(self: &INormalizationLayer) -> f32
pub fn getEpsilon(self: &INormalizationLayer) -> f32
Get the epsilon value used for the normalization calculation.
The epsilon value used for the normalization calculation.
Sourcepub fn setAxes(self: Pin<&mut INormalizationLayer>, axesMask: u32)
pub fn setAxes(self: Pin<&mut INormalizationLayer>, axesMask: u32)
Set the reduction axes for the normalization calculation.
axesMaskThe axes used for the normalization calculation.
Sourcepub fn getAxes(self: &INormalizationLayer) -> u32
pub fn getAxes(self: &INormalizationLayer) -> u32
Get the axes value used for the normalization calculation.
The axes used for the normalization calculation.
Sourcepub fn setNbGroups(self: Pin<&mut INormalizationLayer>, nbGroups: i64)
pub fn setNbGroups(self: Pin<&mut INormalizationLayer>, nbGroups: i64)
Set the number of groups used to split the channels in the normalization calculation.
The input tensor channels are divided into nbGroups groups, and normalization is performed per group. The channel dimension is considered to be the second dimension in a [N, C, H, W, …] formatted tensor.
The default nbGroups is 1.
It is an error to set nbGroups to a value that does not evenly divide into the number of channels of the input tensor.
When nbGroups is != 1, it is expected that the provided axesMask will have all bits corresponding to dimensions after the channel dimension set to 1, with all other bits set to 0.
nbGroupsThe number of groups to split the channels into for the normalization calculation.
Sourcepub fn getNbGroups(self: &INormalizationLayer) -> i64
pub fn getNbGroups(self: &INormalizationLayer) -> i64
Get the number of groups used to split the channels for the normalization calculation.
The number of groups used to split the channel used for the normalization calculation.
Sourcepub fn isV2(self: &INormalizationLayer) -> bool
pub fn isV2(self: &INormalizationLayer) -> bool
Returns true if this layer was created through addNormalizationV2().
Whether the layer was created through addNormalizationV2().