pub struct MaxFunction;Expand description
Maximum function: f(x, y) = max(x, y) Subgradient depends on which input is larger
Trait Implementations§
Source§impl Debug for MaxFunction
impl Debug for MaxFunction
Source§impl DynFunction for MaxFunction
impl DynFunction for MaxFunction
Source§fn is_differentiable(&self) -> bool
fn is_differentiable(&self) -> bool
Whether this function is differentiable
Source§fn memory_complexity(&self) -> MemoryComplexity
fn memory_complexity(&self) -> MemoryComplexity
Memory complexity hint for optimization
Source§fn computational_complexity(&self) -> ComputationalComplexity
fn computational_complexity(&self) -> ComputationalComplexity
Computational complexity hint for optimization
Source§fn is_fusable(&self) -> bool
fn is_fusable(&self) -> bool
Whether this function can be fused with others
Source§fn metadata(&self) -> FunctionMetadata
fn metadata(&self) -> FunctionMetadata
Get function metadata for optimization
Source§impl SerializableFunction for MaxFunction
impl SerializableFunction for MaxFunction
Source§fn deserialize(data: &[u8]) -> Result<Box<dyn SerializableFunction>>where
Self: Sized,
fn deserialize(data: &[u8]) -> Result<Box<dyn SerializableFunction>>where
Self: Sized,
Deserialize the function from bytes
Source§fn format_version(&self) -> u32
fn format_version(&self) -> u32
Get the function’s serialization format version
Source§impl SubgradientFunction for MaxFunction
impl SubgradientFunction for MaxFunction
Source§fn forward<T>(
&self,
_ctx: &mut FunctionContext,
inputs: &[&dyn AutogradTensor<T>],
) -> Result<Vec<Box<dyn AutogradTensor<T>>>>where
T: TensorElement + Float,
fn forward<T>(
&self,
_ctx: &mut FunctionContext,
inputs: &[&dyn AutogradTensor<T>],
) -> Result<Vec<Box<dyn AutogradTensor<T>>>>where
T: TensorElement + Float,
Forward pass computation
Source§fn subgradient<T>(
&self,
_ctx: &mut FunctionContext,
grad_outputs: &[&dyn AutogradTensor<T>],
) -> Result<Vec<Option<SubgradientSet<T>>>>where
T: TensorElement + Float,
fn subgradient<T>(
&self,
_ctx: &mut FunctionContext,
grad_outputs: &[&dyn AutogradTensor<T>],
) -> Result<Vec<Option<SubgradientSet<T>>>>where
T: TensorElement + Float,
Subgradient computation for non-differentiable operations
Returns a set of possible subgradients
Auto Trait Implementations§
impl Freeze for MaxFunction
impl RefUnwindSafe for MaxFunction
impl Send for MaxFunction
impl Sync for MaxFunction
impl Unpin for MaxFunction
impl UnsafeUnpin for MaxFunction
impl UnwindSafe for MaxFunction
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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