pub struct ProximalOperator {
pub lambda: f64,
}Expand description
A proximal operator parameterised by a regularisation strength lambda.
Fields§
§lambda: f64Regularisation strength λ > 0.
Implementations§
Source§impl ProximalOperator
impl ProximalOperator
Sourcepub fn prox_l1(&self, x: f64) -> f64
pub fn prox_l1(&self, x: f64) -> f64
Apply the L1 (soft-thresholding) proximal operator: prox_{λ|·|}(x).
Sourcepub fn prox_l2_sq(&self, x: f64) -> f64
pub fn prox_l2_sq(&self, x: f64) -> f64
Apply the L2-squared proximal operator: prox_{λ||·||²/2}(x).
Sourcepub fn prox_huber_val(&self, x: f64, delta: f64) -> f64
pub fn prox_huber_val(&self, x: f64, delta: f64) -> f64
Apply the Huber proximal operator with delta parameter.
Sourcepub fn prox_box_indicator(&self, x: f64, lo: f64, hi: f64) -> f64
pub fn prox_box_indicator(&self, x: f64, lo: f64, hi: f64) -> f64
Apply the indicator proximal operator for the box [lo, hi].
The proximal map of the indicator function of a convex set is just the projection onto that set.
Sourcepub fn prox_l1_vec(&self, x: &[f64]) -> Vec<f64>
pub fn prox_l1_vec(&self, x: &[f64]) -> Vec<f64>
Apply the L1 proximal operator elementwise to a vector.
Sourcepub fn prox_l2_sq_vec(&self, x: &[f64]) -> Vec<f64>
pub fn prox_l2_sq_vec(&self, x: &[f64]) -> Vec<f64>
Apply the L2-squared proximal operator elementwise to a vector.
Trait Implementations§
Source§impl Clone for ProximalOperator
impl Clone for ProximalOperator
Source§fn clone(&self) -> ProximalOperator
fn clone(&self) -> ProximalOperator
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 moreAuto Trait Implementations§
impl Freeze for ProximalOperator
impl RefUnwindSafe for ProximalOperator
impl Send for ProximalOperator
impl Sync for ProximalOperator
impl Unpin for ProximalOperator
impl UnsafeUnpin for ProximalOperator
impl UnwindSafe for ProximalOperator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.