Shrinkage

shrinkage::ErasedPathPenalty

Shrinkage for Rust · rust · 0.3.0

pub struct ErasedPathPenalty<P>(P)

Adapt a typed penalty shape to independently selected runtime path factories. Numerical dispatch remains at whole proximal-operation boundaries.

Inherent implementation

impl<P> ErasedPathPenalty<P>

new

pub fn new(penalty: P) -> Self

Retain the penalty's automatic path capabilities before boxing it.

Implementation of PathPenalty

impl<P: PathPenalty> PathPenalty for ErasedPathPenalty<P> where <P as PathPenalty>::AtStrength: 'static

AtStrength

type AtStrength = Box<dyn ProximalPenalty<Error = FitError>>;

at_strength

fn at_strength(
    &self,
    lambda: f64
) -> Result<<Self as PathPenalty>::AtStrength, FitError>

maximum_penalty

fn maximum_penalty(&self, gradient: &[f64]) -> Result<PenaltyMaximum, FitError>

path_anchor

fn path_anchor(&self, gradient: &[f64]) -> Result<f64, FitError>

Implementation of Penalty

impl<P: ProximalPenalty> Penalty for ErasedPathPenalty<P>

Error

type Error = FitError;

validate_input

fn validate_input(&self, input: &[f64]) -> Result<(), FitError>

value

fn value(&self, input: &[f64]) -> Result<f64, FitError>

Implementation of ProximalPenalty

impl<P: ProximalPenalty> ProximalPenalty for ErasedPathPenalty<P>

gap_safe

fn gap_safe(&self) -> Option<&dyn shrinkage::GapSafePenalty>

prox

fn prox(
    &self,
    input: &[f64],
    step: f64,
    output: &mut [f64]
) -> Result<(), FitError>

Implementation of Freeze

impl<P> Freeze for ErasedPathPenalty<P> where P: Freeze

Implementation of RefUnwindSafe

impl<P> RefUnwindSafe for ErasedPathPenalty<P> where P: RefUnwindSafe

Implementation of Send

impl<P> Send for ErasedPathPenalty<P> where P: Send

Implementation of Sync

impl<P> Sync for ErasedPathPenalty<P> where P: Sync

Implementation of Unpin

impl<P> Unpin for ErasedPathPenalty<P> where P: Unpin

Implementation of UnsafeUnpin

impl<P> UnsafeUnpin for ErasedPathPenalty<P> where P: UnsafeUnpin

Implementation of UnwindSafe

impl<P> UnwindSafe for ErasedPathPenalty<P> where P: UnwindSafe

Implementation of Any

impl<T> Any for T where T: 'static + ?Sized

Implementation of Borrow

impl<T> Borrow<T> for T where T: ?Sized

Implementation of BorrowMut

impl<T> BorrowMut<T> for T where T: ?Sized

Implementation of ByRef

impl<T> ByRef<T> for T

Implementation of CastableFrom

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT where ST: ?Sized, DT: ?Sized

Implementation of CastableFrom

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT where ST: ?Sized, DT: ?Sized

Implementation of From

impl<T> From<T> for T

Implementation of Imply

impl<T, U> Imply<T> for U where T: ?Sized, U: ?Sized

Implementation of Into

impl<T, U> Into<U> for T where U: From<T>

Implementation of IntoEither

impl<T> IntoEither for T

Implementation of Pointable

impl<T> Pointable for T

Implementation of Read

impl<T> Read<Exclusive, BecauseExclusive> for T where T: ?Sized

Implementation of Same

impl<T> Same for T

Implementation of SupersetOf

impl<SS, SP> SupersetOf<SS> for SP where SS: SubsetOf<SP>

Implementation of TryFrom

impl<T, U> TryFrom<U> for T where U: Into<T>

Implementation of TryInto

impl<T, U> TryInto<U> for T where U: TryFrom<T>