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 sameObjectivetrait 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-kdegree vector with total degree at most the fit degree) and a matching coefficient per term. A pointxin the box[low, high]maps coordinate by coordinate tot in [-1, 1]^k; the surrogate value issum_j coeff_j * prod_d T_{terms_j[d]}(t_d), whereT_nis 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.
- 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^nand a basisW 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 coordinater in R^kdecodes tox = clip(x0 + W r)in the inner box. The reduced objective evaluates the inner objective at the decoded point, so a sampler searches inR^kwhile 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^kto a full pointx 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 kbasis, and the reduced boxboundsinR^k.Panics when the shapes disagree:
origin.len()andbasis.nrows()must equalinner.dim(), andbasis.ncols()must equalbounds.dims.