pub struct InstanceNorm2d<D: Dtype, IT, OT, const RANK: usize> {
pub num_features: usize,
pub eps: f64,
pub momentum: f64,
pub affine: bool,
pub track_running_stats: bool,
/* private fields */
}Expand description
Instance normalisation over a 4-D [N, C, H, W] input.
Fields§
§num_features: usizeNumber of channels/features.
eps: f64Numerical stability constant added to the variance.
momentum: f64Weight of the current batch in the running-stats exponential moving average.
affine: boolWhether to learn per-channel scale (gamma) and shift (beta) parameters.
track_running_stats: boolWhether to maintain running mean/variance across batches.
Implementations§
Source§impl<D: Dtype, IT, OT, const RANK: usize> InstanceNorm2d<D, IT, OT, RANK>
impl<D: Dtype, IT, OT, const RANK: usize> InstanceNorm2d<D, IT, OT, RANK>
Sourcepub fn new(num_features: usize) -> Self
pub fn new(num_features: usize) -> Self
Creates a new layer with default eps/momentum, affine/running-stats off.
Sourcepub fn with_momentum(self, m: f64) -> Self
pub fn with_momentum(self, m: f64) -> Self
Sets the running-stats EMA momentum.
Sourcepub fn with_affine(self, a: bool) -> Self
pub fn with_affine(self, a: bool) -> Self
Sets whether to learn per-channel scale/shift parameters.
Sourcepub fn with_track_running_stats(self, t: bool) -> Self
pub fn with_track_running_stats(self, t: bool) -> Self
Sets whether to maintain running mean/variance across batches.
Trait Implementations§
Source§impl<D: Dtype, IT: Tensor<D, RANK> + EagerTensor, OT: Tensor<D, RANK>, const RANK: usize> Layer<IT> for InstanceNorm2d<D, IT, OT, RANK>
impl<D: Dtype, IT: Tensor<D, RANK> + EagerTensor, OT: Tensor<D, RANK>, const RANK: usize> Layer<IT> for InstanceNorm2d<D, IT, OT, RANK>
Auto Trait Implementations§
impl<D, IT, OT, const RANK: usize> Freeze for InstanceNorm2d<D, IT, OT, RANK>
impl<D, IT, OT, const RANK: usize> RefUnwindSafe for InstanceNorm2d<D, IT, OT, RANK>
impl<D, IT, OT, const RANK: usize> Send for InstanceNorm2d<D, IT, OT, RANK>
impl<D, IT, OT, const RANK: usize> Sync for InstanceNorm2d<D, IT, OT, RANK>
impl<D, IT, OT, const RANK: usize> Unpin for InstanceNorm2d<D, IT, OT, RANK>
impl<D, IT, OT, const RANK: usize> UnsafeUnpin for InstanceNorm2d<D, IT, OT, RANK>
impl<D, IT, OT, const RANK: usize> UnwindSafe for InstanceNorm2d<D, IT, OT, RANK>
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