Skip to content

Choosing a Map Parameterization ​

A crucial aspect of constructing transport maps is the choice of map parameterization. In addition to the choice of the univariate basis functions, the construction of the multi-index set that defines the multi-dimensional polynomial expansion for each component can significantly influence the performance of the map.

The -th component of a triangular transport map is defined as    [4]

Positivity of ensures that each component is strictly increasing in its last coordinate. Global invertibility also requires suitable component ranges; see the Introduction. A common choice for is the softplus function, defined as   .

Rectifier Functions ​

The rectifier acts on   inside the component integral, so  . A strictly positive output enforces a positive diagonal derivative. TransportMaps.jl provides the following rectifiers:

ConstructorDefinitionProperties
Softplus(β=1.0)  Smooth and strictly positive for  ; larger sharpens the transition toward ReLU.
ShiftedELU()  for  ;    otherwiseStrictly positive and continuously differentiable; exponential on the negative side and linear on the positive side.
ExpRectifier() Smooth and strictly positive; grows rapidly for positive inputs.
IdentityRectifier() Leaves the derivative unchanged; use only when positivity is enforced separately.

Softplus() is the default. ShiftedELU() has  , whereas Softplus() has  . Thus, zero polynomial coefficients give different initial diagonal slopes. ExpRectifier() also has  , but its rapid growth can create large map derivatives. IdentityRectifier() does not enforce monotonicity: zero or negative inputs produce zero or negative slopes. Strict positivity alone does not guarantee the component ranges needed for a global transport; see the Introduction.

Comparing the Functions ​

The plot includes two softplus parameters to show the effect of . The dashed identity curve illustrates where positivity fails. Comparison of the built-in rectifier functions and softplus parametersComparison of the built-in rectifier functions and softplus parameters

From a Non-Monotone Polynomial to a Monotone Function ​

Following the rectification-and-integration construction illustrated in Figure 8 of [5], take a weighted sum of first-, second-, and third-order shifted Legendre polynomials on , with coefficients  . The resulting has a derivative that changes sign. For each rectifier, construct

The three panels show the original function, the rectified derivative, and its integral. The positive rectifiers give strictly increasing functions; the dashed identity case recovers and remains non-monotone. All functions start at . They are not rescaled to share an endpoint: rectification changes both the shape and the range, and does not itself enforce a particular output support. Shifted Legendre polynomial, rectified derivatives, and integrated monotone functionsShifted Legendre polynomial, rectified derivatives, and integrated monotone functions

Polynomial Expansion and Map Structure ​

Further, is a multivariate polynomial function parameterized by coefficients . The polynomial function can be expressed as a linear combination of multivariate basis functions:

Here,   are multivariate basis functions constructed from univariate basis functions , and is the multi-index set that determines which polynomial terms are included in the expansion.

By selecting an appropriate multi-index set , the structure of the map itself can be tailored to the problem at hand. This includes the ability to create sparse maps, which can be particularly beneficial in high-dimensional settings or when the underlying relationships are known to be simpler. This feature is similar to the concept of sparse polynomial chaos expansions (PCE) used in (forward) uncertainty propagation [10].

In TransportMaps.jl, three types of map structures outlined in [3] are implemented. Further, we implement a hyperbolic truncation using the -pseudo-norm introduced in sparse PCE [11].

  • Total Order Map: Includes all terms up to a specified total degree for dimensions. In order to maintain the triangular structure, the -th component of the map only depends on the first variables. Thus, the multivariate basis for the -th component is constructed from the first univariate bases. The multi-index set satisfies:
  • No-Mixed Terms Map: Excludes mixed terms, retaining only pure terms for each variable. The multi-index set satisfies:
  • Diagonal Map: Includes only diagonal terms, where each variable is independent of the others. The multi-index set for the -th component satisfies:
  • Hyperbolic / q‑norm truncation: Includes multi‑indices whose quasi‑norm is bounded by . For   define

  recovers the total‑degree basis,   penalizes high‑order interactions and keeps low‑dimensional high‑degree (univariate) terms, producing a sparser interaction structure [11].

For an better overview, the multi-index sets for each map type will be visualized later.

Constructing Maps with Different Parameterizations ​

We will now demonstrate how to construct and compare the three types of map parameterizations using TransportMaps.jl.

Then we define the three types of (sparse) maps. We consider a two-dimensional map with polynomial degree  , softplus as the rectifier function, and Hermite polynomials as the univariate basis functions.

Total Order Map ​

julia
M_to = PolynomialMap(2, 3, Normal(), Softplus(), HermiteBasis())
# alternative: PolynomialMap(2, 3, Normal(), Softplus(), HermiteBasis(), :total)

No-mixed-terms Map ​

We can use the NoMixedMap constructor for this map type:

julia
M_nm = NoMixedMap(2, 3, Normal(), Softplus(), HermiteBasis())
# alternative: PolynomialMap(2, 3, Normal(), Softplus(), HermiteBasis(), :no_mixed)

Diagonal Map ​

For the diagonal map, we can use the DiagonalMap constructor:

julia
M_d = DiagonalMap(2, 3, Normal(), Softplus(), HermiteBasis())
# alternative: PolynomialMap(2, 3, Normal(), Softplus(), HermiteBasis(), :diagonal)

Hyperbolic Map ​

Finally, we also construct a map with hyperbolic truncation with  :

julia
M_q = HyperbolicMap(2, 3, 0.7, Normal(), Softplus(), HermiteBasis())
# alternative: PolynomialMap(2, 3, Normal(), Softplus(), HermiteBasis(), :hyperbolic, 0.5)

Visualizing Multi-Index Sets ​

The multi-index set determines the terms included in the polynomial expansion. We extract the multi-index sets of the second component of each map for visualization:

Extract the multi-index sets of the second component of each map for visualization:

julia
ind_to = getmultiindexsets(M_to.components[2])
ind_nm = getmultiindexsets(M_nm.components[2])
ind_d = getmultiindexsets(M_d.components[2])

Finally, we plot the multi-index sets for each map type. This allows us to reproduce the comparison of multi-index sets as shown in Figure 1 in [3]: Multi Index SetsMulti Index Sets

Visualize the Hyperbolic truncation ​

To show the effects of the truncation by -norm [11], we visualize the multi-index sets for a hyperbolic truncation with   dimensions, degree   and different . q-norm Animationq-norm Animation

Example: Comparing Map Parameterizations ​

We optimize the coefficients of each map to match a cubic target density. The target density is defined as:

where is the standard normal PDF.

Define the cubic target density and visualize it:

julia
logtarget(x) = logpdf(Normal(), x[1]) + logpdf(Normal(), x[2] - x[1]^3 - x[1]^2)
Cubic DensityCubic Density

We create the MapTargetDensity and quadrature weights for optimization:

julia
target = MapTargetDensity(logtarget)
quadrature = SparseSmolyakWeights(3, M_to)

Generate samples in the standard normal space for the variance diagnostic:

julia
samples_z = randn(1000, 2)

Now, we optimize each map type, compute the variance diagnostic and visualize the mapped samples.

Total Order Map ​

We start with the total order map:

julia
optimize!(M_to, target, quadrature)

mapped_samples = evaluate(M_to, samples_z)
var_diag = variance_diagnostic(M_to, target, samples_z)
println("Variance Diagnostic: ", var_diag)
Variance Diagnostic: 1.280764095316695e-16
Total OrderTotal Order

No Mixed Terms Map ​

Next, we optimize the no-mixed-terms map:

julia
optimize!(M_nm, target, quadrature)

mapped_samples_no_mixed = evaluate(M_nm, samples_z)
var_diag_no_mixed = variance_diagnostic(M_nm, target, samples_z)
println("Variance Diagnostic: ", var_diag_no_mixed)
Variance Diagnostic: 1.4031239100796406e-16
No MixedNo Mixed

Diagonal Map ​

Finally, we optimize the diagonal map:

julia
optimize!(M_d, target, quadrature)

mapped_samples_diagonal = evaluate(M_d, samples_z)
var_diag_diagonal = variance_diagnostic(M_d, target, samples_z)
println("Variance Diagnostic: ", var_diag_diagonal)
Variance Diagnostic: 0.09872800975991762
DiagonalDiagonal

We observe that the total order and no-mixed-terms maps achieve similar variance diagnostics, while the diagonal map performs significantly worse due to its inability to capture dependencies between variables.

Adaptive Map Construction

The choice of map parameterization can significantly impact the performance of transport maps. In practice, one might start with a simpler map structure, such as the diagonal or no-mixed-terms map, and then adaptively enrich the map based on the observed performance, as discussed in [4]. This adaptive approach allows for a balance between computational efficiency and approximation accuracy. For more information see the Adaptive Transport Maps manual and [4].


This page was generated using Literate.jl.