Struct burn_core::nn::BatchNormConfig
source · pub struct BatchNormConfig {
pub num_features: usize,
pub epsilon: f64,
pub momentum: f64,
}Expand description
Configuration to create a BatchNorm layer.
Fields§
§num_features: usizeThe number of features.
epsilon: f64A value required for numerical stability. Default: 1e-5
momentum: f64Momentum used to update the metrics. Default: 0.1
Implementations§
source§impl BatchNormConfig
impl BatchNormConfig
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
sourcepub fn with_momentum(self, momentum: f64) -> Self
pub fn with_momentum(self, momentum: f64) -> Self
Momentum used to update the metrics. Default: 0.1
source§impl BatchNormConfig
impl BatchNormConfig
sourcepub fn init<B: Backend, const D: usize>(&self) -> BatchNorm<B, D>
pub fn init<B: Backend, const D: usize>(&self) -> BatchNorm<B, D>
Initialize a new batch norm module.
sourcepub fn init_with<B: Backend, const D: usize>(
&self,
record: BatchNormRecord<B, D>
) -> BatchNorm<B, D>
pub fn init_with<B: Backend, const D: usize>( &self, record: BatchNormRecord<B, D> ) -> BatchNorm<B, D>
Initialize a new batch norm module with a record.
Trait Implementations§
source§impl Clone for BatchNormConfig
impl Clone for BatchNormConfig
source§impl Config for BatchNormConfig
impl Config for BatchNormConfig
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 Debug for BatchNormConfig
impl Debug for BatchNormConfig
source§impl<'de> Deserialize<'de> for BatchNormConfig
impl<'de> Deserialize<'de> for BatchNormConfig
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 BatchNormConfig
impl Display for BatchNormConfig
Auto Trait Implementations§
impl RefUnwindSafe for BatchNormConfig
impl Send for BatchNormConfig
impl Sync for BatchNormConfig
impl Unpin for BatchNormConfig
impl UnwindSafe for BatchNormConfig
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