pub struct NormalizationFactory;Expand description
Normalization layer factory for common configurations
Implementations§
Source§impl NormalizationFactory
impl NormalizationFactory
Sourcepub fn batch_norm(num_features: usize) -> Result<BatchNorm2d>
pub fn batch_norm(num_features: usize) -> Result<BatchNorm2d>
Create a batch normalization layer for 2D inputs (most common)
Sourcepub fn layer_norm(normalized_shape: Vec<usize>) -> Result<LayerNorm>
pub fn layer_norm(normalized_shape: Vec<usize>) -> Result<LayerNorm>
Create a layer normalization for transformer-like architectures
Sourcepub fn group_norm(num_groups: usize, num_channels: usize) -> Result<GroupNorm>
pub fn group_norm(num_groups: usize, num_channels: usize) -> Result<GroupNorm>
Create a group normalization layer
Sourcepub fn instance_norm(num_features: usize) -> Result<InstanceNorm2d>
pub fn instance_norm(num_features: usize) -> Result<InstanceNorm2d>
Create an instance normalization layer for 2D inputs
Sourcepub fn switchable_norm(num_features: usize) -> Result<SwitchableNorm2d>
pub fn switchable_norm(num_features: usize) -> Result<SwitchableNorm2d>
Create a switchable normalization layer that adapts between different norms
Sourcepub fn rms_norm(normalized_shape: Vec<usize>) -> Result<RMSNorm>
pub fn rms_norm(normalized_shape: Vec<usize>) -> Result<RMSNorm>
Create RMS normalization for transformer models
Sourcepub fn batch_norm_training(num_features: usize) -> Result<BatchNorm2d>
pub fn batch_norm_training(num_features: usize) -> Result<BatchNorm2d>
Create batch normalization optimized for training
Sourcepub fn batch_norm_inference(num_features: usize) -> Result<BatchNorm2d>
pub fn batch_norm_inference(num_features: usize) -> Result<BatchNorm2d>
Create batch normalization optimized for inference
Auto Trait Implementations§
impl Freeze for NormalizationFactory
impl RefUnwindSafe for NormalizationFactory
impl Send for NormalizationFactory
impl Sync for NormalizationFactory
impl Unpin for NormalizationFactory
impl UnsafeUnpin for NormalizationFactory
impl UnwindSafe for NormalizationFactory
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more