pub struct L2NormalizeLayerParams {
pub epsilon: f32,
}Expand description
A layer that performs L2 normalization, i.e. divides by the the square root of the sum of squares of all elements of input.
.. code::
y = L2NormalizeLayer(x)Requires 1 input and produces 1 output.
Input A blob with rank greater than equal to 3. 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.
This layer is described by the following formula:
.. math:: x_i \leftarrow \dfrac{x_i}{\sqrt{\sum{x_i^2} + \epsilon}}
Fields§
§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 L2NormalizeLayerParams
impl Clone for L2NormalizeLayerParams
Source§fn clone(&self) -> L2NormalizeLayerParams
fn clone(&self) -> L2NormalizeLayerParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for L2NormalizeLayerParams
impl Debug for L2NormalizeLayerParams
Source§impl Default for L2NormalizeLayerParams
impl Default for L2NormalizeLayerParams
Source§impl Message for L2NormalizeLayerParams
impl Message for L2NormalizeLayerParams
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
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,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
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,
Encodes the message with a length-delimiter to a buffer. Read more
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,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
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,
Decodes a length-delimited instance of the message from the buffer.
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,
Decodes an instance of the message from a buffer, and merges it into
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,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for L2NormalizeLayerParams
impl PartialEq for L2NormalizeLayerParams
Source§fn eq(&self, other: &L2NormalizeLayerParams) -> bool
fn eq(&self, other: &L2NormalizeLayerParams) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for L2NormalizeLayerParams
impl StructuralPartialEq for L2NormalizeLayerParams
Auto Trait Implementations§
impl Freeze for L2NormalizeLayerParams
impl RefUnwindSafe for L2NormalizeLayerParams
impl Send for L2NormalizeLayerParams
impl Sync for L2NormalizeLayerParams
impl Unpin for L2NormalizeLayerParams
impl UnsafeUnpin for L2NormalizeLayerParams
impl UnwindSafe for L2NormalizeLayerParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more