pub struct ReducedObjective<O: Objective<f64>> { /* private fields */ }Expand description
Affine dimension-collapse of an inner objective onto a k-dimensional box.
Given a full-space origin x0 in R^n and a basis W in R^{n x k} whose
columns span the retained subspace (for example the dominant eigenvectors
of the pilot gradient covariance, an active subspace), the reduced
coordinate r in R^k decodes to x = clip(x0 + W r) in the inner box. The
reduced objective evaluates the inner objective at the decoded point, so a
sampler searches in R^k while every value is the true objective.
Implementations§
Source§impl<O: Objective<f64>> ReducedObjective<O>
impl<O: Objective<f64>> ReducedObjective<O>
Sourcepub fn new(
inner: O,
origin: Array1<f64>,
basis: Array2<f64>,
bounds: Bounds<f64>,
) -> Self
pub fn new( inner: O, origin: Array1<f64>, basis: Array2<f64>, bounds: Bounds<f64>, ) -> Self
Builds a reduced objective from an inner objective, a full-space origin,
an n x k basis, and the reduced box bounds in R^k.
Panics when the shapes disagree: origin.len() and basis.nrows() must
equal inner.dim(), and basis.ncols() must equal bounds.dims.
Trait Implementations§
Source§impl<O: Objective<f64> + Gradient<f64>> DifferentiableObjective<f64> for ReducedObjective<O>
impl<O: Objective<f64> + Gradient<f64>> DifferentiableObjective<f64> for ReducedObjective<O>
Source§fn value_and_gradient(&self, x: ArrayView1<'_, T>) -> (T, Array1<T>)
fn value_and_gradient(&self, x: ArrayView1<'_, T>) -> (T, Array1<T>)
Returns
(f(x), ∇f(x)). Default calls the two methods separately;
analytic implementations should override for efficiency.Source§impl<O: Objective<f64>> Objective<f64> for ReducedObjective<O>
impl<O: Objective<f64>> Objective<f64> for ReducedObjective<O>
Source§fn eval_batch(&self, x: ArrayView2<'_, T>) -> Array1<T>
fn eval_batch(&self, x: ArrayView2<'_, T>) -> Array1<T>
Evaluates a batch of points (rows of
x). Read moreSource§fn global_min(&self) -> Option<&FPair<T>>
fn global_min(&self) -> Option<&FPair<T>>
Optional known global minimum, used for benchmarking and convergence
checks. Default returns
None.Auto Trait Implementations§
impl<O> Forget for ReducedObjective<O>
impl<O> Freeze for ReducedObjective<O>where
O: Freeze,
impl<O> RefUnwindSafe for ReducedObjective<O>where
O: RefUnwindSafe,
impl<O> Send for ReducedObjective<O>
impl<O> Sync for ReducedObjective<O>
impl<O> Unpin for ReducedObjective<O>where
O: Unpin,
impl<O> UnsafeUnpin for ReducedObjective<O>where
O: UnsafeUnpin,
impl<O> UnwindSafe for ReducedObjective<O>where
O: UnwindSafe,
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> 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