pub struct LayerNormConfig {
pub normalized_shape: usize,
pub eps: f64,
pub elementwise_affine: bool,
}Expand description
Configuration for layer normalization
Fields§
§normalized_shape: usizeNormalized dimension (typically d_model)
eps: f64Small constant for numerical stability
elementwise_affine: boolWhether to include learnable scale parameter (γ)
Implementations§
Source§impl LayerNormConfig
impl LayerNormConfig
Sourcepub fn with_elementwise_affine(self, elementwise_affine: bool) -> Self
pub fn with_elementwise_affine(self, elementwise_affine: bool) -> Self
Set whether to use elementwise affine transformation
Trait Implementations§
Source§impl Clone for LayerNormConfig
impl Clone for LayerNormConfig
Source§fn clone(&self) -> LayerNormConfig
fn clone(&self) -> LayerNormConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 LayerNormConfig
impl Debug for LayerNormConfig
Source§impl<'de> Deserialize<'de> for LayerNormConfig
impl<'de> Deserialize<'de> for LayerNormConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for LayerNormConfig
impl PartialEq for LayerNormConfig
Source§impl Serialize for LayerNormConfig
impl Serialize for LayerNormConfig
impl StructuralPartialEq for LayerNormConfig
Auto Trait Implementations§
impl Freeze for LayerNormConfig
impl RefUnwindSafe for LayerNormConfig
impl Send for LayerNormConfig
impl Sync for LayerNormConfig
impl Unpin for LayerNormConfig
impl UnwindSafe for LayerNormConfig
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