pub struct QuadraticProbe { /* private fields */ }Expand description
A separable quadratic probe L(w) = ½ Σ c_i (w_i - center_i)².
Its gradient is g_i = c_i (w_i - center_i) and its Hessian is the diagonal matrix
diag(c), so the per-coordinate curvature values are exactly the eigenvalues. This
makes it the natural fixture for exercising the condition-number meta-feature: an
anisotropic curvature vector produces a known, controllable condition number.
An optional gradient-noise level turns the probe into a stochastic oracle whose per-sample noise is seeded by the sample index, so repeated samples differ yet the whole extraction stays reproducible.
Implementations§
Source§impl QuadraticProbe
impl QuadraticProbe
Sourcepub fn new(curvature: Array1<f64>, init: Array1<f64>) -> Result<Self>
pub fn new(curvature: Array1<f64>, init: Array1<f64>) -> Result<Self>
Build a bowl with per-coordinate curvature (the Hessian diagonal), centered at
the origin, started from init.
Sourcepub fn isotropic(dim: usize, curvature: f64, init_value: f64) -> Result<Self>
pub fn isotropic(dim: usize, curvature: f64, init_value: f64) -> Result<Self>
Build an isotropic dim-dimensional bowl with constant curvature, started from a
constant init_value in every coordinate.
Sourcepub fn with_center(self, center: Array1<f64>) -> Result<Self>
pub fn with_center(self, center: Array1<f64>) -> Result<Self>
Override the bowl center (the location of the minimum).
Sourcepub fn with_noise(self, noise_std: f64, seed: u64) -> Self
pub fn with_noise(self, noise_std: f64, seed: u64) -> Self
Turn the probe into a stochastic oracle whose gradient samples carry uniform noise
of the given standard deviation, seeded by seed.
Trait Implementations§
Source§impl Clone for QuadraticProbe
impl Clone for QuadraticProbe
Source§impl Debug for QuadraticProbe
impl Debug for QuadraticProbe
Auto Trait Implementations§
impl Freeze for QuadraticProbe
impl RefUnwindSafe for QuadraticProbe
impl Send for QuadraticProbe
impl Sync for QuadraticProbe
impl Unpin for QuadraticProbe
impl UnsafeUnpin for QuadraticProbe
impl UnwindSafe for QuadraticProbe
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,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.