pub struct UnaryFunctionLayerParams {
pub type: i32,
pub alpha: f32,
pub epsilon: f32,
pub shift: f32,
pub scale: f32,
}Expand description
A layer that applies a unary function.
.. code::
y = UnaryFunctionLayer(x)Requires 1 input and produces 1 output.
Input A blob with no rank constraints. Output A blob with the same shape as the input.
The input is first modified by shifting and scaling:
.. math:: x \leftarrow \text{scale} \cdot x + \text{shift}
Fields§
§type: i32The type of unary function.
alpha: f32A constant used in POWER and THRESHOLD functions.
epsilon: f32A small constant to avoid division by 0 while normalizing variance.
Defaults to 1e-6 if not set or set to 0.
shift: f32Input is shifted by this amount
before the unary function is applied.
Defaults to 0.0 if not set.
scale: f32Input is scaled by this amount
before the unary function is applied.
Defaults to 1.0 if not set or set to 0.
Implementations§
Trait Implementations§
Source§impl Clone for UnaryFunctionLayerParams
impl Clone for UnaryFunctionLayerParams
Source§fn clone(&self) -> UnaryFunctionLayerParams
fn clone(&self) -> UnaryFunctionLayerParams
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 UnaryFunctionLayerParams
impl Debug for UnaryFunctionLayerParams
Source§impl Default for UnaryFunctionLayerParams
impl Default for UnaryFunctionLayerParams
Source§impl Message for UnaryFunctionLayerParams
impl Message for UnaryFunctionLayerParams
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 UnaryFunctionLayerParams
impl PartialEq for UnaryFunctionLayerParams
Source§fn eq(&self, other: &UnaryFunctionLayerParams) -> bool
fn eq(&self, other: &UnaryFunctionLayerParams) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for UnaryFunctionLayerParams
impl StructuralPartialEq for UnaryFunctionLayerParams
Auto Trait Implementations§
impl Freeze for UnaryFunctionLayerParams
impl RefUnwindSafe for UnaryFunctionLayerParams
impl Send for UnaryFunctionLayerParams
impl Sync for UnaryFunctionLayerParams
impl Unpin for UnaryFunctionLayerParams
impl UnsafeUnpin for UnaryFunctionLayerParams
impl UnwindSafe for UnaryFunctionLayerParams
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