pub struct HardShrinkConfig {
pub lambda: f64,
}Expand description
Configuration to create a HardShrink layer using the init function.
Fields§
§lambda: f64The lambda value for the Hard Shrink formulation. Default is 0.5
Implementations§
Source§impl HardShrinkConfig
impl HardShrinkConfig
Sourcepub fn with_lambda(self, lambda: f64) -> Self
pub fn with_lambda(self, lambda: f64) -> Self
Sets the value for the field lambda.
The lambda value for the Hard Shrink formulation. Default is 0.5
- Defaults to
"0.5"
Source§impl HardShrinkConfig
impl HardShrinkConfig
Sourcepub fn init(&self) -> HardShrink
pub fn init(&self) -> HardShrink
Initialize a new HardShrink Layer
Trait Implementations§
Source§impl Clone for HardShrinkConfig
impl Clone for HardShrinkConfig
Source§impl Config for HardShrinkConfig
impl Config for HardShrinkConfig
Source§fn save<P>(&self, file: P) -> Result<(), Error>
fn save<P>(&self, file: P) -> Result<(), Error>
Available on crate feature
std only.Saves the configuration to a file. Read more
Source§fn load<P>(file: P) -> Result<Self, ConfigError>
fn load<P>(file: P) -> Result<Self, ConfigError>
Available on crate feature
std only.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 HardShrinkConfig
impl Debug for HardShrinkConfig
Source§impl<'de> Deserialize<'de> for HardShrinkConfig
impl<'de> Deserialize<'de> for HardShrinkConfig
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 HardShrinkConfig
impl Display for HardShrinkConfig
Source§impl From<HardShrinkConfig> for ActivationConfig
impl From<HardShrinkConfig> for ActivationConfig
Source§fn from(config: HardShrinkConfig) -> Self
fn from(config: HardShrinkConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for HardShrinkConfig
impl RefUnwindSafe for HardShrinkConfig
impl Send for HardShrinkConfig
impl Sync for HardShrinkConfig
impl Unpin for HardShrinkConfig
impl UnsafeUnpin for HardShrinkConfig
impl UnwindSafe for HardShrinkConfig
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