pub struct InstanceNormConfig {
pub num_channels: usize,
pub epsilon: f64,
pub affine: bool,
}Expand description
Configuration to create a InstanceNorm layer using the init function.
Fields§
§num_channels: usizeThe number of channels expected in the input
epsilon: f64A value required for numerical stability. Default: 1e-5
affine: boolA boolean value that when set to true, this module has learnable
per-channel affine parameters initialized to ones (for weights)
and zeros (for biases). Default: true
Implementations§
Source§impl InstanceNormConfig
impl InstanceNormConfig
Sourcepub fn new(num_channels: usize) -> InstanceNormConfig
pub fn new(num_channels: usize) -> InstanceNormConfig
Create a new instance of the config.
§Arguments
§Required Arguments
§num_channels
The number of channels expected in the input
§Default Arguments
§epsilon
A value required for numerical stability. Default: 1e-5
- Defaults to
1e-5
§affine
A boolean value that when set to true, this module has learnable
per-channel affine parameters initialized to ones (for weights)
and zeros (for biases). Default: true
- Defaults to
true
Source§impl InstanceNormConfig
impl InstanceNormConfig
Sourcepub fn with_epsilon(self, epsilon: f64) -> InstanceNormConfig
pub fn with_epsilon(self, epsilon: f64) -> InstanceNormConfig
Sets the value for the field epsilon.
A value required for numerical stability. Default: 1e-5
- Defaults to
1e-5
Sourcepub fn with_affine(self, affine: bool) -> InstanceNormConfig
pub fn with_affine(self, affine: bool) -> InstanceNormConfig
Sets the value for the field affine.
A boolean value that when set to true, this module has learnable
per-channel affine parameters initialized to ones (for weights)
and zeros (for biases). Default: true
- Defaults to
true
Source§impl InstanceNormConfig
impl InstanceNormConfig
Sourcepub fn init<B>(&self, device: &<B as BackendTypes>::Device) -> InstanceNorm<B>where
B: Backend,
pub fn init<B>(&self, device: &<B as BackendTypes>::Device) -> InstanceNorm<B>where
B: Backend,
Initialize a new instance norm module.
Trait Implementations§
Source§impl Clone for InstanceNormConfig
impl Clone for InstanceNormConfig
Source§fn clone(&self) -> InstanceNormConfig
fn clone(&self) -> InstanceNormConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more