pub struct MeanVarianceNormalizeLayerParams {
pub across_channels: bool,
pub normalize_variance: bool,
pub epsilon: f32,
}Expand description
A layer that performs mean variance normalization, along axis = -3.
.. code::
y = MeanVarianceNormalizeLayer(x)Requires 1 input and produces 1 output.
Input A blob with rank greater than equal to 3. Example: Rank 4 blob represents [Batch, channels, height, width] For ranks greater than 3, the leading dimensions, starting from 0 to -4 (inclusive), are all treated as batch.
Output A blob with the same shape as the input.
If acrossChannels == true
normalization is performed on flattened input, i.e. the input is reshaped to (Batch,C), where “Batch” contains
all dimensions from 0 to -4 (inclusive), and C contains dimensions -1, -2, -3.
If acrossChannels == false
normalization is performed within a channel,
across spatial dimensions (i.e. last two dimensions).
Fields§
§across_channels: boolIf true, mean and variance are computed across channels.
normalize_variance: boolIf false, only mean is subtracted.
epsilon: f32A small constant to avoid division by 0 while normalizing variance.
Defaults to 1e-6 if not set or set to 0.
Trait Implementations§
Source§impl Clone for MeanVarianceNormalizeLayerParams
impl Clone for MeanVarianceNormalizeLayerParams
Source§fn clone(&self) -> MeanVarianceNormalizeLayerParams
fn clone(&self) -> MeanVarianceNormalizeLayerParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Message for MeanVarianceNormalizeLayerParams
impl Message for MeanVarianceNormalizeLayerParams
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for MeanVarianceNormalizeLayerParams
impl PartialEq for MeanVarianceNormalizeLayerParams
Source§fn eq(&self, other: &MeanVarianceNormalizeLayerParams) -> bool
fn eq(&self, other: &MeanVarianceNormalizeLayerParams) -> bool
self and other values to be equal, and is used by ==.