mod additive¶
- module additive¶
Separable rank-1 surrogate and its tempered independence sampler. Separable rank-1 surrogate: the base case of the functional tensor train.
A high-dimensional objective is modelled additively,
f(x) ~= c + sum_j g_j(x_j), with eachg_ja first-kind Chebyshev energy in one coordinate. This is a rank-1 functional tensor train in the fulldcoordinates, so it carries no active-subspace collapse and the tempered Gibbs densityexp(-f/T)factorises across coordinates exactly whenfis separable. That factorisation is what theAdditiveSurrogate::sampleindependence proposal exploits: each coordinate is drawn from its own 1D tempered marginalexp(-g_j/T)/Z_j(T)by inverse-CDF, inO(d m)with no curse of dimensionality, so a single draw places every coordinate at its tempered optimum at once – the regime an active-subspace surrogate cannot reach.Like
crate::reduced::ChebyshevSurrogate, the surrogate is anObj-transform: it implementsObjective, so every point of the sampling algebra consumes it through the same trait. The fit decouples per coordinate (onedegree x degreesolve each), which keeps it linear indand usable at native CUTEst sizes. A Metropolis accept against the true objective debiases the mean-field error when the objective is not separable.Structs and Unions
- struct AdditiveSurrogate¶
A separable rank-1 Chebyshev energy model
c + sum_j g_j(x_j).Implementations
- impl AdditiveSurrogate¶
Functions
- fn fit(x: ArrayView2<f64>, y: ArrayView1<f64>, bounds: Bounds<f64>, degree: usize) -> Self¶
Fit the surrogate to pilot points
x(n x d) and valuesy(n) with a default of 12 backfitting passes.
- fn fit_backfit(x: ArrayView2<f64>, y: ArrayView1<f64>, bounds: Bounds<f64>, degree: usize, n_passes: usize) -> Self¶
Fit by backfitting (Gauss-Seidel over coordinates).
The intercept is the pilot mean. Each coordinate’s Chebyshev coefficients are refit in turn against the partial residual y - intercept - sum_{l != j} g_l, on a mean-centred design so the fit is consistent under uniform sampling. Sweeping all coordinates
n_passestimes removes the finite-sample cross-coordinate contamination that an independent per-coordinate fit leaves behind, converging to the joint least-squares additive model while stayingO(n_passes d (n degree + degree^3))– linear ind, unlike the joint solve. Each coordinate’s Gram factor is cached, so a pass costs only one triangular solve per coordinate.Panics when shapes disagree or
degree == 0.
- fn gradient(&self, x: ArrayView1<f64>) -> Array1<f64>¶
Analytic gradient of the separable surrogate at
x.
- fn sample<R: Rng + ?Sized>(&self, n: usize, temperature: f64, grid_m: usize, rng: &mut R) -> Array2<f64>¶
Draw
nindependence proposals from the tempered surrogate densityexp(-(f - f_min)/T)by per-coordinate inverse-CDF sampling on angrid_m-point grid. Each coordinate is sampled independently (the separable factorisation), with a uniform within-cell jitter for continuity. Returns ann x darray of points inside the box.
- fn value(&self, x: ArrayView1<f64>) -> f64¶
Surrogate value at full point
x.
Traits implemented
- impl Objective<f64> for AdditiveSurrogate¶
- impl Gradient<f64> for AdditiveSurrogate¶