Struct burn_core::nn::LayerNormConfig
source · pub struct LayerNormConfig {
pub d_model: usize,
pub epsilon: f64,
}Expand description
Configuration to create a LayerNorm layer.
Fields§
§d_model: usizeThe size of the input features.
epsilon: f64A value required for numerical stability. Default: 1e-5
Implementations§
source§impl LayerNormConfig
impl LayerNormConfig
sourcepub fn with_epsilon(self, epsilon: f64) -> Self
pub fn with_epsilon(self, epsilon: f64) -> Self
A value required for numerical stability. Default: 1e-5
source§impl LayerNormConfig
impl LayerNormConfig
sourcepub fn init<B: Backend>(&self) -> LayerNorm<B>
pub fn init<B: Backend>(&self) -> LayerNorm<B>
Initialize a new layer norm module.
sourcepub fn init_with<B: Backend>(&self, record: LayerNormRecord<B>) -> LayerNorm<B>
pub fn init_with<B: Backend>(&self, record: LayerNormRecord<B>) -> LayerNorm<B>
Initialize a new layer norm module with a record.
Trait Implementations§
source§impl Clone for LayerNormConfig
impl Clone for LayerNormConfig
source§impl Config for LayerNormConfig
impl Config for LayerNormConfig
source§fn save<P: AsRef<Path>>(&self, file: P) -> Result<()>
fn save<P: AsRef<Path>>(&self, file: P) -> Result<()>
Saves the configuration to a file. Read more
source§fn load<P: AsRef<Path>>(file: P) -> Result<Self, ConfigError>
fn load<P: AsRef<Path>>(file: P) -> Result<Self, ConfigError>
Loads the configuration from a file. Read more
source§fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
Loads the configuration from a binary buffer. Read more
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 Display for LayerNormConfig
impl Display for LayerNormConfig
Auto Trait Implementations§
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