mod reduced

module reduced

Dimension-collapse and Chebyshev surrogate Obj-transforms. Dimension-collapse and Chebyshev surrogate components for the typed algebra.

These two primitives are Obj-transforms: each takes the objective slot of the typed component algebra and returns another objective, so any sampler built on the algebra (single-chain SA, the MCMC variants, parallel tempering, or the HMC point) consumes them through the same Objective trait without modification. A high-dimensional objective is made tractable by collapsing the search to a low-dimensional active subspace (ReducedObjective) and, after a pilot phase, replacing the restricted objective by a cheap total-degree Chebyshev model with an analytic gradient (ChebyshevSurrogate). Because both are objectives, the same collapse and surrogate serve every point of the algebra at once.

Structs and Unions

struct ChebyshevSurrogate

Total-degree Chebyshev surrogate objective on a box in R^k.

The surrogate stores a list of multi-indices terms (each a length-k degree vector with total degree at most the fit degree) and a matching coefficient per term. A point x in the box [low, high] maps coordinate by coordinate to t in [-1, 1]^k; the surrogate value is sum_j coeff_j * prod_d T_{terms_j[d]}(t_d), where T_n is the Chebyshev polynomial of the first kind. Coefficients are fit elsewhere (least squares on pilot samples in the reduced box); this type supplies the cheap value and the analytic gradient that the HMC point consumes.

Implementations

impl ChebyshevSurrogate

Functions

fn grad(&self, x: ArrayView1<f64>) -> Array1<f64>

Analytic gradient of the surrogate at x, in box coordinates.

fn new(bounds: Bounds<f64>, terms: Vec<Vec<usize>>, coeffs: Array1<f64>) -> Self

Builds a surrogate from a reduced box, the total-degree multi-index set, and one coefficient per multi-index.

Panics when terms.len() != coeffs.len() or when any multi-index length differs from bounds.dims.

struct ReducedObjective<O: Objective<f64>>

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

impl<O: Objective<f64>> ReducedObjective<O>

Functions

fn decode(&self, r: ArrayView1<f64>) -> Array1<f64>

Decodes a reduced coordinate r in R^k to a full point x in R^n, clipped to the inner objective’s box.

fn inner(&self) -> &O

Borrows the wrapped full-dimensional objective.

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.