Hierarchical multifidelity maps¶
Hierarchical multifidelity transport replaces one difficult high-fidelity
transport with a composition of simpler stage maps. This page develops the two
hierarchical formulations implemented by HierarchicalTriangularMap and then
connects each mathematical object to the library.
The basic target-to-reference convention and pullback notation are reviewed in the notation guide. The single-fidelity guide develops the monotone stage-map parameterization and its two training paths. Here, the prescribed reference is \(\eta=\mathcal N(0,I)\).
Ordered fidelity data¶
Let \(\pi_\ell\) denote the target density at fidelity \(\ell\). For the hierarchical methods, MFTT requires the user to specify a fidelity ordering
where the arrows point toward increasing fidelity: \(\pi_0\) is the high-fidelity target and \(\pi_M\) is the lowest-fidelity target. For each level, the available dataset is
The datasets need not be paired and may contain different numbers of samples,
but they must have the same coordinate dimension. Supply them in
high-to-low order as [X_0, ..., X_M]. The hierarchy is user specified; MFTT
does not infer or reorder the fidelity levels.
Tri-fidelity changing-reference (left) and fixed-reference (right) constructions. The upper rows proceed from low- to high-fidelity training; left-pointing arrows are learned target-to-reference maps and right-pointing arrows are their inverses. The bottom row shows the final transport from \(\pi_0\) to \(\eta\).¶
The two formulations differ in what changes at each stage:
Property |
Changing reference |
Fixed reference |
|---|---|---|
Stage reference |
Map-induced \(q_\ell\) |
Standard normal \(\eta\) |
Stage data |
Samples from \(\pi_\ell\) |
Samples transformed by lower-fidelity maps |
Stage interpretation |
Transport toward the adjacent lower fidelity |
Residual correction to a cumulative transport |
Final composition |
\(\widehat A_M\circ\cdots\circ\widehat A_0\) |
\(\widehat B_0\circ\cdots\circ\widehat B_M\) |
Forward evaluation order |
\(0,1,\ldots,M\) |
\(M,M-1,\ldots,0\) |
Optimization structure |
Generally coupled after the first stage |
Componentwise with Gaussian \(\eta\) |
Most suitable when |
Adjacent-fidelity transports are simple |
Lower-fidelity maps leave simple residuals |
Both methods train stages from the lowest fidelity to the highest, \(\ell=M,M-1,\ldots,0\).
Changing-reference hierarchy¶
Formulation¶
The ideal changing-reference decomposition is
The lowest-fidelity map sends \(\pi_M\) to \(\eta\). Every subsequent map mimics a transport between adjacent fidelity levels: \(\boldsymbol A_\ell\) sends \(\pi_\ell\) toward \(\pi_{\ell+1}\).
In the learned construction, initialize \(q_M:=\eta\). At stage \(\ell\), train a triangular map such that
For \(\ell=M,M-1,\ldots,1\), its pullback becomes the reference for the next higher-fidelity stage:
Thus \(q_{\ell-1}\approx\pi_\ell\). The final learned map is
Stagewise training¶
Given \(q_\ell\) and \(\mathcal X_\ell\), stage \(\ell\) minimizes
For a tri-fidelity hierarchy, the procedure is:
Train \(\widehat{\boldsymbol A}_2\) on \(\mathcal X_2\) against \(q_2=\eta\), then set \(q_1=\widehat{\boldsymbol A}_2^\sharp q_2\).
Train \(\widehat{\boldsymbol A}_1\) on \(\mathcal X_1\) against \(q_1\), then set \(q_0=\widehat{\boldsymbol A}_1^\sharp q_1\).
Train \(\widehat{\boldsymbol A}_0\) on \(\mathcal X_0\) against \(q_0\).
Evaluate a high-fidelity point by applying \(\widehat{\boldsymbol A}_0\), then \(\widehat{\boldsymbol A}_1\), then \(\widehat{\boldsymbol A}_2\).
After the lowest-fidelity stage, \(q_\ell\) is map induced and need not be
Gaussian, log-concave, or factorized. The component objectives are therefore
generally coupled. MFTT uses the all-at-once analytic-gradient training path
(TriangularMap.train_aao) for every changing-reference stage. This method
faithfully models adjacent transports, but recursive reference evaluation can
make it more expensive and harder to optimize. Indeed, with few exceptions, we recommend using the fixed-reference
hiearchical method presented below. Empirically, it is both faster to train and more stable.
Fixed-reference hierarchy¶
Formulation¶
The fixed-reference construction keeps \(\eta\) at every stage and transforms the data instead. Its ideal composition is
At the lowest fidelity, set \(\boldsymbol y_M^{(j)}:=\boldsymbol x_M^{(j)}\). For each \(\ell=M-1,M-2,\ldots,0\), transform the current dataset through every map already learned at lower fidelities:
If the lower-fidelity composition already sends \(\pi_\ell\) close to \(\eta\), then \(\widehat{\boldsymbol B}_\ell\) only needs to learn the remaining residual correction. Each stage solves
The resulting transport is
Stagewise training¶
For a tri-fidelity hierarchy, the procedure is:
Train \(\widehat{\boldsymbol B}_2\) on \(\mathcal X_2\) against \(\eta\).
Form \(\boldsymbol y_1=\widehat{\boldsymbol B}_2(\boldsymbol x_1)\) and train \(\widehat{\boldsymbol B}_1\) on those transformed samples against \(\eta\).
Form \(\boldsymbol y_0=(\widehat{\boldsymbol B}_1\circ \widehat{\boldsymbol B}_2)(\boldsymbol x_0)\) and train \(\widehat{\boldsymbol B}_0\) against \(\eta\).
Evaluate a high-fidelity point in that same map order: \(\widehat{\boldsymbol B}_2\), then \(\widehat{\boldsymbol B}_1\), then \(\widehat{\boldsymbol B}_0\).
Because every stage uses the factorized standard-Gaussian reference, MFTT uses
the componentwise TriangularMap.train path. Fixed-reference training is
therefore usually faster and more stable than changing-reference training.
From the equations to MFTT¶
Assume X_0, X_1, and X_2 are two-dimensional NumPy arrays whose rows are
samples. Configure one MapParams object per fidelity, in the same
high-to-low order as the data:
from mftt import (
HierarchicalMapParams,
HierarchicalTriangularMap,
MapParams,
OptimizationParams,
)
X_ell = [X_0, X_1, X_2]
optimization = OptimizationParams(
optimizer="BFGS", reg_cst=1e-8, gtol=1e-6, maxiter=200
)
hierarchical_params = HierarchicalMapParams(
fidelity_map_params=[
MapParams(total_order=2, optimization=optimization)
for _ in X_ell
]
)
# Use separate objects to retain both trained compositions.
changing = HierarchicalTriangularMap(X_ell, hierarchical_params)
fixed = HierarchicalTriangularMap(X_ell, hierarchical_params)
changing.train(method="changing_reference")
fixed.train(method="fixed_reference")
z_changing = changing.evaluate(X_0[:32])
z_fixed = fixed.evaluate(X_0[:32])
x_draws = fixed.sample(1000)
print(changing.evaluation_order) # [0, 1, 2]
print(fixed.evaluation_order) # [2, 1, 0]
The configurations may use different basis orders or regularization at each
fidelity. Passing optimization=... directly to train instead applies one
optimizer configuration to every stage. The reg_cst field is the code-level
counterpart of \(\lambda_\ell^A\) or \(\lambda_\ell^B\).
Mathematical object |
Library representation |
|---|---|
\(\mathcal X_\ell\) |
|
\(\widehat A_\ell\) or \(\widehat B_\ell\) |
|
Changing-reference \(q_\ell\) |
|
Fixed-reference transformed samples \(\boldsymbol y_\ell\) |
|
Stage coefficients \(\boldsymbol\theta_\ell\) |
|
Regularization \(\lambda_\ell^A\) or \(\lambda_\ell^B\) |
|
Final target-to-reference composition |
|
Inverse composition |
|
Forward stage order |
|
Internal standardization and inspection¶
MFTT independently standardizes each fidelity dataset before stage training.
The stage maps themselves then use identity standardization, so all stage
compositions act in standardized coordinates. Public methods accept and return
raw high-fidelity coordinates: evaluate applies the high-fidelity
standardization, while inverse, sampling, and density methods undo or account
for it.
After training:
stages[ell]contains the fidelity index, configuration, raw data, actual stage training data, reference, and trained stage map.stagesandmapsremain in fidelity order[0, ..., M]; useevaluation_orderto determine composition order.partial_evaluations(x)returns the high-fidelity-standardized input and the state after every stage in evaluation order.Calling
trainagain resets all stage maps and replaces the previous fit. Create separate objects when comparing the two methods.
For a complete executable tutorial, continue to the hierarchical notebook. See the hierarchical API reference for all methods and shared operations for inversion, conditional sampling, and density evaluation.