pub struct GroupNorm<D: Dtype, IT, OT, const RANK: usize> {
pub num_groups: usize,
pub num_channels: usize,
pub eps: f64,
pub affine: bool,
/* private fields */
}Expand description
Group normalisation over num_groups groups of channels.
Input shape: [N, C, *] — normalises over (C/num_groups, *) per sample.
Output shape: same as input.
Parameters:
num_groups— number of groups to divide C into (must divide C evenly)num_channels— number of channels Ceps— numerical stability constant (default 1e-5)affine— if true, learns per-channel γ and β (default true)
Fields§
§num_groups: usizeNumber of groups to divide the channels into.
num_channels: usizeNumber of channels.
eps: f64Numerical stability constant added to the variance.
affine: boolWhether to learn per-channel scale (gamma) and shift (beta) parameters.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<D, IT, OT, const RANK: usize> Freeze for GroupNorm<D, IT, OT, RANK>
impl<D, IT, OT, const RANK: usize> RefUnwindSafe for GroupNorm<D, IT, OT, RANK>
impl<D, IT, OT, const RANK: usize> Send for GroupNorm<D, IT, OT, RANK>
impl<D, IT, OT, const RANK: usize> Sync for GroupNorm<D, IT, OT, RANK>
impl<D, IT, OT, const RANK: usize> Unpin for GroupNorm<D, IT, OT, RANK>
impl<D, IT, OT, const RANK: usize> UnsafeUnpin for GroupNorm<D, IT, OT, RANK>
impl<D, IT, OT, const RANK: usize> UnwindSafe for GroupNorm<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