Struct HardtanhConfig
pub struct HardtanhConfig {
pub min_val: f64,
pub max_val: f64,
}Expand description
Configuration to create a Hardtanh layer using the init function.
Fields§
§min_val: f64The finite minimum value of the linear region range. Default is -1.0.
Must be less than or equal to max_val.
max_val: f64The finite maximum value of the linear region range. Default is 1.0.
Must be greater than or equal to min_val.
Implementations§
§impl HardtanhConfig
impl HardtanhConfig
pub fn new() -> HardtanhConfig
pub fn new() -> HardtanhConfig
Create a new instance of the config.
§Arguments
§Default Arguments
§min_val
The finite minimum value of the linear region range. Default is -1.0.
Must be less than or equal to max_val.
- Defaults to
"-1.0"
§max_val
The finite maximum value of the linear region range. Default is 1.0.
Must be greater than or equal to min_val.
- Defaults to
"1.0"
§impl HardtanhConfig
impl HardtanhConfig
pub fn with_min_val(self, min_val: f64) -> HardtanhConfig
pub fn with_min_val(self, min_val: f64) -> HardtanhConfig
Sets the value for the field min_val.
The finite minimum value of the linear region range. Default is -1.0.
Must be less than or equal to max_val.
- Defaults to
"-1.0"
pub fn with_max_val(self, max_val: f64) -> HardtanhConfig
pub fn with_max_val(self, max_val: f64) -> HardtanhConfig
Sets the value for the field max_val.
The finite maximum value of the linear region range. Default is 1.0.
Must be greater than or equal to min_val.
- Defaults to
"1.0"
§impl HardtanhConfig
impl HardtanhConfig
Trait Implementations§
§impl Clone for HardtanhConfig
impl Clone for HardtanhConfig
§fn clone(&self) -> HardtanhConfig
fn clone(&self) -> HardtanhConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Config for HardtanhConfig
impl Config for HardtanhConfig
§impl Debug for HardtanhConfig
impl Debug for HardtanhConfig
§impl<'de> Deserialize<'de> for HardtanhConfig
impl<'de> Deserialize<'de> for HardtanhConfig
§fn deserialize<D>(
deserializer: D,
) -> Result<HardtanhConfig, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<HardtanhConfig, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl Display for HardtanhConfig
impl Display for HardtanhConfig
§impl Serialize for HardtanhConfig
impl Serialize for HardtanhConfig
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Auto Trait Implementations§
impl Freeze for HardtanhConfig
impl RefUnwindSafe for HardtanhConfig
impl Send for HardtanhConfig
impl Sync for HardtanhConfig
impl Unpin for HardtanhConfig
impl UnsafeUnpin for HardtanhConfig
impl UnwindSafe for HardtanhConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more