pub enum ActivationSpec {
Named {
name: String,
negative_slope: Option<f32>,
},
Unsupported(Value),
}Expand description
How a layer-array’s activation field was specified in the .nam.
NAM A1 writes a bare string ("Tanh"); A2 may write a dict
({"type": "LeakyReLU", "negative_slope": 0.01}). A per-layer list (a
distinct activation per layer) is not modeled and is captured as
ActivationSpec::Unsupported, which the runtime rejects with
crate::Error::UnsupportedFeature rather than silently mis-running.
Variants§
Named
A single named activation, with an optional negative slope (LeakyReLU).
Fields
Unsupported(Value)
A shape this crate does not model (e.g. a per-layer activation list).
Trait Implementations§
Source§impl Clone for ActivationSpec
impl Clone for ActivationSpec
Source§fn clone(&self) -> ActivationSpec
fn clone(&self) -> ActivationSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ActivationSpec
impl Debug for ActivationSpec
Source§impl<'de> Deserialize<'de> for ActivationSpec
impl<'de> Deserialize<'de> for ActivationSpec
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 PartialEq for ActivationSpec
impl PartialEq for ActivationSpec
Source§fn eq(&self, other: &ActivationSpec) -> bool
fn eq(&self, other: &ActivationSpec) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ActivationSpec
Auto Trait Implementations§
impl Freeze for ActivationSpec
impl RefUnwindSafe for ActivationSpec
impl Send for ActivationSpec
impl Sync for ActivationSpec
impl Unpin for ActivationSpec
impl UnsafeUnpin for ActivationSpec
impl UnwindSafe for ActivationSpec
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