# API - TransportMaps¶

Sub-modules

Classes

Class Description
TMO Base object for every object in the module.
SumChunkReduce Define the summation of the chunks operation.
TupleSumChunkReduce Define the summation of the chunks operation over list of tuples.
TensorDotReduce Define the reduce tensordot operation carried out through the mpi_map function
ExpectationReduce Define the expectation operation carried out through the mpi_map function
AbsExpectationReduce Define the expectation of the absolute value: $$\mathbb{E}[\vert {\bf X} \vert]$$
TupleExpectationReduce Define the expectation operation applied on a tuple
cached
cached_tuple

Functions

Function Description
deprecate
setLogLevel Set the log level for all existing and new objects related to the TransportMaps module
counted
get_mpi_pool Get a pool of n processors
mpi_eval Interface for the parallel evaluation of a generic function on points x
mpi_map Interface for the parallel evaluation of a generic function on points x
mpi_map_alloc_dmem Interface for the parallel evaluation of a generic function on points x
mpi_alloc_dmem List of keyworded arguments to be allocated in the distributed memory.
distributed_sampling
generate_total_order_midxs Generate a total order multi-index
total_time_cost_function
get_sub_cache
taylor_test Test the gradient and Hessian of a function using the Taylor test.
kl_divergence Compute $$\mathcal{D}_{KL}(\pi_1 | \pi_2)$$
grad_a_kl_divergence Compute $$\nabla_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})$$
hess_a_kl_divergence Compute $$\nabla^2_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})$$
tuple_grad_a_kl_divergence Compute $$\left(\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}}),\nabla_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})\right)$$
action_stored_hess_a_kl_divergence Evaluate action of $$\nabla^2_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})$$ on vector $$v$$.
storage_hess_a_kl_divergence Assemble $$\nabla^2_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})$$.
action_hess_a_kl_divergence Compute $$\langle\nabla^2_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}}),\delta{\bf }\rangle$$
kl_divergence_component Compute $$-\sum_{i=0}^m f(x_i) = -\sum_{i=0}^m \log\pi\circ T_k(x_i) + \log\partial_{x_k}T_k(x_i)$$
grad_a_kl_divergence_component Compute $$-\sum_{i=0}^m \nabla_{\bf a}f[{\bf a}](x_i) = -\sum_{i=0}^m \nabla_{\bf a} \left(\log\pi\circ T_k[{\bf a}](x_i) + \log\partial_{x_k}T_k[{\bf a}](x_i)\right)$$
hess_a_kl_divergence_component Compute $$-\sum_{i=0}^m \nabla^2_{\bf a}f[{\bf a}](x_i) = -\sum_{i=0}^m \nabla^2_{\bf a} \left(\log\pi\circ T_k[{\bf a}](x_i) + \log\partial_{x_k}T_k[{\bf a}](x_i)\right)$$
misfit_squared Compute $$\vert f_1 - f_2 \vert^2$$
grad_a_misfit_squared Compute $$\nabla_{\bf a}\vert f_{1,{\bf a}} - f_2 \vert^2$$
hess_a_misfit_squared Compute $$\nabla^2_{\bf a}\vert f_{1,{\bf a}} - f_2 \vert^2$$
L2_misfit Compute $$\Vert f_1 - f_2 \Vert_{L^2_\pi}$$
L2squared_misfit Compute $$\Vert f_1 - f_2 \Vert^2_{L^2_\pi}$$
grad_a_L2squared_misfit Compute $$\nabla_{\bf a}\Vert f_{1,{\bf a}} - f_2 \Vert^2_{L^2_\pi}$$
hess_a_L2squared_misfit Compute $$\nabla^2_{\bf a}\Vert f_{1,{\bf a}} - f_2 \Vert^2_{L^2_\pi}$$
storage_hess_a_L2squared_misfit Assemble $$\nabla^2_{\bf a}\Vert f_{1,{\bf a}} - f_2 \Vert^2_{L^2_\pi}$$.
action_stored_hess_a_L2squared_misfit Evaluate the action of $$\nabla^2_{\bf a}\Vert f_{1,{\bf a}} - f_2 \Vert^2_{L^2_\pi}$$ on $$v$$.
grad_t_kl_divergence Compute $$\nabla_T \mathcal{D}_{KL}(\pi_1, \pi_2(T))$$.
grad_x_grad_t_kl_divergence Compute $$\nabla_x \nabla_T \mathcal{D}_{KL}(\pi_1, \pi_2(T))$$.
tuple_grad_x_grad_t_kl_divergence Compute $$\nabla_x \nabla_T \mathcal{D}_{KL}(\pi_1, \pi_2(T))$$.
laplace_approximation Compute the Laplace approximation of the distribution $$\pi$$.
laplace_approximation_withBounds Compute the Laplace approximation of the distribution $$\pi$$.
maximum_likelihood Compute the maximum likelihood of the log-likelihood $$\log\pi({\bf y}\vert{\bf x})$$.
Default_IsotropicIntegratedExponentialTriangularTransportMap Generate a triangular transport map with default settings.
Default_IsotropicIntegratedExponentialDiagonalTransportMap Generate a diagonal transport map with default settings.
Default_IsotropicIntegratedSquaredTriangularTransportMap Generate a triangular transport map with default settings.
Default_IsotropicIntegratedSquaredDiagonalTransportMap Generate a diagonal transport map with default settings.
Default_IsotropicMonotonicLinearSpanTriangularTransportMap Generate a triangular transport map with default settings.
Default_IsotropicLinearSpanTriangularTransportMap Generate a triangular transport map with default settings.
Default_LinearSpanTriangularTransportMap Generate a linear span triangular transport map with default settings and user defined sparsity and orders.

Documentation

class TransportMaps.TMO[source]

Base object for every object in the module.

This object provides functions for storage and parallelization.

store(fname, force=False)[source]

Store the object with the selected file name fname

Parameters: fname (str) – file name force (bool) – whether to force overwriting
TransportMaps.setLogLevel(level)[source]

Set the log level for all existing and new objects related to the TransportMaps module

Parameters: level (int) – logging level
TransportMaps.get_mpi_pool()[source]

Get a pool of n processors

Returns: (mpi_map.MPI_Pool) – pool of processors

Usage example:

import numpy as np
import numpy.random as npr
from TransportMaps import get_mpi_pool, mpi_map

class Operator(object):
def __init__(self, a):
self.a = a
def sum(self, x, n=1):
out = x
for i in range(n):
out += self.a
return out

op = Operator(2.)
x = npr.randn(100,5)
n = 2

pool = get_mpi_pool()
pool.start(3)
try:
xsum = mpi_map("sum", op, x, (n,), mpi_pool=pool)
finally:
pool.stop()

TransportMaps.mpi_eval(f, scatter_tuple=None, bcast_tuple=None, dmem_key_in_list=None, dmem_arg_in_list=None, dmem_val_in_list=None, dmem_key_out_list=None, obj=None, reduce_obj=None, reduce_tuple=None, import_set=None, mpi_pool=None, splitted=False, concatenate=True)[source]

Interface for the parallel evaluation of a generic function on points x

Parameters: f (object or str) – function or string identifying the function in object obj scatter_tuple (tuple) – tuple containing 2 lists of [keys] and [arguments] which will be scattered to the processes. bcast_tuple (tuple) – tuple containing 2 lists of [keys] and [arguments] which will be broadcasted to the processes. dmem_key_in_list (list) – list of string containing the keys to be fetched (or created with default None if missing) from the distributed memory and provided as input to f. dmem_val_in_list (list) – list of objects corresponding to the keys defined in dmem_key_in_list, used in case we are not executing in parallel dmem_key_out_list (list) – list of keys to be assigned to the outputs beside the first one obj (object) – object where the function f_name is defined reduce_obj (object) – object ReduceObject defining the reduce method to be applied (if any) reduce_tuple (object) – tuple containing 2 lists of [keys] and [arguments] which will be scattered to the processes to be used by reduce_obj import_set (set) – list of couples (module_name,as_field) to be imported as import module_name as as_field mpi_pool (mpi_map.MPI_Pool) – pool of processors splitted (bool) – whether the scattering input is already splitted or not concatenate (bool) – whether to concatenate the output (the output of f must be a numpy.ndarray object
TransportMaps.mpi_map(f, scatter_tuple=None, bcast_tuple=None, dmem_key_in_list=None, dmem_arg_in_list=None, dmem_val_in_list=None, obj=None, obj_val=None, reduce_obj=None, reduce_tuple=None, mpi_pool=None, splitted=False, concatenate=True)[source]

Interface for the parallel evaluation of a generic function on points x

Parameters: f (object or str) – function or string identifying the function in object obj scatter_tuple (tuple) – tuple containing 2 lists of [keys] and [arguments] which will be scattered to the processes. bcast_tuple (tuple) – tuple containing 2 lists of [keys] and [arguments] which will be broadcasted to the processes. dmem_key_in_list (list) – list of string containing the keys to be fetched (or created with default None if missing) from the distributed memory and provided as input to f. dmem_val_in_list (list) – list of objects corresponding to the keys defined in dmem_key_in_list, used in case we are not executing in parallel obj (object or str) – object where the function f_name is defined obj_val (object) – object to be used in case not executing in parallel and obj is a string reduce_obj (object) – object ReduceObject defining the reduce method to be applied (if any) reduce_tuple (object) – tuple containing 2 lists of [keys] and [arguments] which will be scattered to the processes to be used by reduce_obj mpi_pool (mpi_map.MPI_Pool) – pool of processors splitted (bool) – whether the scattering input is already splitted or not concatenate (bool) – whether to concatenate the output (the output of f must be a numpy.ndarray object
TransportMaps.mpi_map_alloc_dmem(f, scatter_tuple=None, bcast_tuple=None, dmem_key_in_list=None, dmem_arg_in_list=None, dmem_val_in_list=None, dmem_key_out_list=None, obj=None, obj_val=None, reduce_obj=None, reduce_tuple=None, mpi_pool=None, splitted=False, concatenate=True)[source]

Interface for the parallel evaluation of a generic function on points x

Parameters: f (object or str) – function or string identifying the function in object obj scatter_tuple (tuple) – tuple containing 2 lists of [keys] and [arguments] which will be scattered to the processes. bcast_tuple (tuple) – tuple containing 2 lists of [keys] and [arguments] which will be broadcasted to the processes. dmem_key_in_list (list) – list of string containing the keys to be fetched (or created with default None if missing) from the distributed memory and provided as input to f. dmem_val_in_list (list) – list of objects corresponding to the keys defined in dmem_key_in_list, used in case we are not executing in parallel dmem_key_out_list (list) – list of keys to be assigned to the outputs beside the first one obj (object) – object where the function f_name is defined obj_val (object) – object to be used in case not executing in parallel and obj is a string reduce_obj (object) – object ReduceObject defining the reduce method to be applied (if any) reduce_tuple (object) – tuple containing 2 lists of [keys] and [arguments] which will be scattered to the processes to be used by reduce_obj mpi_pool (mpi_map.MPI_Pool) – pool of processors splitted (bool) – whether the scattering input is already splitted or not concatenate (bool) – whether to concatenate the output (the output of f must be a numpy.ndarray object
TransportMaps.mpi_alloc_dmem(mpi_pool=None, **kwargs)[source]

List of keyworded arguments to be allocated in the distributed memory.

This executes only if an mpi_pool is provided.

Parameters: mpi_pool (mpi_map.MPI_Pool) – pool of processors
class TransportMaps.SumChunkReduce(axis=None)[source]

Define the summation of the chunks operation.

The chunks resulting from the output of the MPI evaluation are summed along their axis.

Parameters: axis (tuple [2]) – tuple containing list of axes to be used in the sum operation
class TransportMaps.TupleSumChunkReduce(axis=None)[source]

Define the summation of the chunks operation over list of tuples.

The chunks resulting from the output of the MPI evaluation are summed along their axis.

Parameters: axis (tuple [2]) – tuple containing list of axes to be used in the sum operation
class TransportMaps.TensorDotReduce(axis)[source]

Define the reduce tensordot operation carried out through the mpi_map function

Parameters: axis (tuple [2]) – tuple containing list of axes to be used in the tensordot operation
class TransportMaps.ExpectationReduce[source]

Define the expectation operation carried out through the mpi_map function

class TransportMaps.AbsExpectationReduce[source]

Define the expectation of the absolute value: $$\mathbb{E}[\vert {\bf X} \vert]$$

class TransportMaps.TupleExpectationReduce[source]

Define the expectation operation applied on a tuple

If we are given a tuple $$(x_1,x_2)$$, the inner reduce returns $$(\langle x_1,w\rangle , \langle x_2, w\rangle)$$.

Given a list of tuples $$\{(x_i,y_i\}_{i=0}^n$$, the outer reduce gives $$(\sum x_i, \sum y_i)$$.

TransportMaps.generate_total_order_midxs(max_order_list)[source]

Generate a total order multi-index

Given the list of maximums $${\bf m}$$, the returned set of multi-index $$I$$ is such that $$\sum_j^d {\bf_i}_j <= max {\bf m}$$ and $${\bf i}_j <= {\bf m}_j$$.

TransportMaps.taylor_test(x, dx, f, gf=None, hf=None, ahf=None, h=0.0001, fungrad=False, caching=False, args={})[source]

Test the gradient and Hessian of a function using the Taylor test.

Using a Taylor expansion around $${\bf x}$$, we have

$f({\bf x}+h \delta{\bf x}) = f({\bf x}) + h (\nabla f({\bf x}))^\top \delta{\bf x} + \frac{h^2}{2} (\delta{\bf x})^\top \nabla^2 f({\bf x}) \delta{\bf x} + \mathcal{O}(h^3)$

Therefore

$\vert f({\bf x}+h \delta{\bf x}) - f({\bf x}) - h (\nabla f({\bf x}))^\top \delta{\bf x} \vert = \mathcal{O}(h^2)$

and

$\vert f({\bf x}+h \delta{\bf x}) - f({\bf x}) - h (\nabla f({\bf x}))^\top \delta{\bf x} - \frac{h^2}{2} (\delta{\bf x})^\top \nabla^2 f({\bf x}) \delta{\bf x} \vert = \mathcal{O}(h^3)$
Parameters: x (ndarray [$$m,d_x$$]) – evaluation points $${\bf x}$$ dx (ndarray [$$m,d_x$$]) – perturbation direction $$\delta{\bf x}$$ f (function) – function $${\bf x} \mapsto f({\bf x})$$. If fungrad==True, then f is the mapping $${\bf x} \mapsto (\nabla f({\bf x}), f({\bf x}))$$. gf (function) – gradient function $${\bf x} \mapsto \nabla f({\bf x})$$ hf (function) – Hessian function $${\bf x} \mapsto \nabla^2 f({\bf x})$$ ahf (function) – action of the Hessian function $${\bf x},\delta{\bf x} \mapsto (\nabla f({\bf x}))^\top \delta{\bf x}$$ h (float) – perturbation step fungrad (bool) – whether f returns also the gradient or not. caching (bool) – whether to pass a cache dictionary to the functions. args (dict) – arguments to be passed to functions
TransportMaps.kl_divergence(d1, d2, params1=None, params2=None, cache=None, qtype=None, qparams=None, x=None, w=None, batch_size=None, mpi_pool_tuple=(None, None), d1_entropy=True)[source]

Compute $$\mathcal{D}_{KL}(\pi_1 | \pi_2)$$

Parameters: d1 (Distribution) – distribution $$\pi_1$$ d2 (Distribution) – distribution $$\pi_2$$ params1 (dict) – parameters for distribution $$\pi_1$$ params2 (dict) – parameters for distribution $$\pi_2$$ cache (dict) – cached values qtype (int) – quadrature type to be used for the approximation of $$\mathbb{E}_{\pi_1}$$ qparams (object) – parameters necessary for the construction of the quadrature x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi_1}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi_1}$$ batch_size (int) – this is the size of the batch to evaluated for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. (Note: if nprocs > 1, then the batch size defines the size of the batch for each process) mpi_pool_tuple (tuple [2] of mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of d1 and d2 d1_entropy (bool) – whether to include the entropy term $$\mathbb{E}_{\pi_1}[\log \pi_1]$$ in the KL divergence (float) – $$\mathcal{D}_{KL}(\pi_1 | \pi_2)$$

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

TransportMaps.grad_a_kl_divergence(d1, d2, params1=None, params2=None, cache=None, qtype=None, qparams=None, x=None, w=None, batch_size=None, mpi_pool_tuple=(None, None))[source]

Compute $$\nabla_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})$$

Parameters: d1 (Distribution) – distribution $$\pi_1$$ d2 (Distribution) – distribution $$\pi_2$$ params1 (dict) – parameters for distribution $$\pi_1$$ params2 (dict) – parameters for distribution $$\pi_2$$ cache (dict) – cached values qtype (int) – quadrature type to be used for the approximation of $$\mathbb{E}_{\pi_1}$$ qparams (object) – parameters necessary for the construction of the quadrature x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi_1}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi_1}$$ batch_size (int) – this is the size of the batch to evaluated for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. mpi_pool_tuple (tuple [2] of mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of d1 and d2 (ndarray [$$N$$] – $$\nabla_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})$$

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

TransportMaps.hess_a_kl_divergence(d1, d2, params1=None, params2=None, cache=None, qtype=None, qparams=None, x=None, w=None, batch_size=None, mpi_pool_tuple=(None, None))[source]

Compute $$\nabla^2_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})$$

Parameters: d1 (Distribution) – distribution $$\pi_1$$ d2 (Distribution) – distribution $$\pi_2$$ params1 (dict) – parameters for distribution $$\pi_1$$ params2 (dict) – parameters for distribution $$\pi_2$$ cache (dict) – cached values qtype (int) – quadrature type to be used for the approximation of $$\mathbb{E}_{\pi_1}$$ qparams (object) – parameters necessary for the construction of the quadrature x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi_1}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi_1}$$ batch_size (int) – this is the size of the batch to evaluated for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. mpi_pool_tuple (tuple [2] of mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of d1 and d2 (ndarray [$$N,N$$] – $$\nabla^2_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})$$

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

TransportMaps.tuple_grad_a_kl_divergence(d1, d2, params1=None, params2=None, cache=None, qtype=None, qparams=None, x=None, w=None, batch_size=None, mpi_pool_tuple=(None, None), d1_entropy=True)[source]

Compute $$\left(\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}}),\nabla_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})\right)$$

Parameters: d1 (Distribution) – distribution $$\pi_1$$ d2 (Distribution) – distribution $$\pi_2$$ params1 (dict) – parameters for distribution $$\pi_1$$ params2 (dict) – parameters for distribution $$\pi_2$$ cache (dict) – cached values qtype (int) – quadrature type to be used for the approximation of $$\mathbb{E}_{\pi_1}$$ qparams (object) – parameters necessary for the construction of the quadrature x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi_1}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi_1}$$ batch_size (int) – this is the size of the batch to evaluated for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. mpi_pool_tuple (tuple [2] of mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of d1 and d2 (tuple) – $$\left(\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}}),\nabla_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})\right)$$

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

TransportMaps.action_stored_hess_a_kl_divergence(H, v)[source]

Evaluate action of $$\nabla^2_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})$$ on vector $$v$$.

Parameters: v (ndarray [$$N$$]) – vector $$v$$ H (ndarray [$$N,N$$]) – Hessian $$\nabla^2_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})$$ (ndarray [$$N$$]) – $$\langle\nabla^2_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}}),v\rangle$$
TransportMaps.storage_hess_a_kl_divergence(d1, d2, params1=None, params2=None, cache=None, qtype=None, qparams=None, x=None, w=None, batch_size=None, mpi_pool_tuple=(None, None))[source]

Assemble $$\nabla^2_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})$$.

Parameters: d1 (Distribution) – distribution $$\pi_1$$ d2 (Distribution) – distribution $$\pi_2$$ params1 (dict) – parameters for distribution $$\pi_1$$ params2 (dict) – parameters for distribution $$\pi_2$$ cache (dict) – cached values qtype (int) – quadrature type to be used for the approximation of $$\mathbb{E}_{\pi_1}$$ qparams (object) – parameters necessary for the construction of the quadrature x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi_1}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi_1}$$ batch_size (int) – this is the size of the batch to evaluated for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. mpi_pool_tuple (tuple [2] of mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of d1 and d2 (None) – the result is stored in params2['hess_a_kl_divergence']

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

Note

the dictionary params2 must be provided

TransportMaps.action_hess_a_kl_divergence(da, d1, d2, params1=None, params2=None, cache=None, qtype=None, qparams=None, x=None, w=None, batch_size=None, mpi_pool_tuple=(None, None))[source]

Compute $$\langle\nabla^2_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}}),\delta{\bf }\rangle$$

Parameters: da (ndarray [$$N$$]) – vector on which to apply the Hessian d1 (Distribution) – distribution $$\pi_1$$ d2 (Distribution) – distribution $$\pi_2$$ params1 (dict) – parameters for distribution $$\pi_1$$ params2 (dict) – parameters for distribution $$\pi_2$$ cache (dict) – cached values qtype (int) – quadrature type to be used for the approximation of $$\mathbb{E}_{\pi_1}$$ qparams (object) – parameters necessary for the construction of the quadrature x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi_1}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi_1}$$ batch_size (int) – this is the size of the batch to evaluated for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. mpi_pool_tuple (tuple [2] of mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of d1 and d2 (ndarray [$$N,N$$] – $$\nabla^2_{\bf a}\mathcal{D}_{KL}(\pi_1 | \pi_{2,{\bf a}})$$

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

TransportMaps.kl_divergence_component(f, params=None, cache=None, x=None, w=None, batch_size=None, mpi_pool=None)[source]

Compute $$-\sum_{i=0}^m f(x_i) = -\sum_{i=0}^m \log\pi\circ T_k(x_i) + \log\partial_{x_k}T_k(x_i)$$

Parameters: f (ProductDistributionParametricPullbackComponentFunction) – function $$f$$ params (dict) – parameters for function $$f$$ cache (dict) – cached values x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi_1}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi_1}$$ batch_size (int) – this is the size of the batch to evaluated for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. (Note: if nprocs > 1, then the batch size defines the size of the batch for each process) mpi_pool (mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of f (float) – value
TransportMaps.grad_a_kl_divergence_component(f, params=None, cache=None, x=None, w=None, batch_size=None, mpi_pool=None)[source]

Compute $$-\sum_{i=0}^m \nabla_{\bf a}f[{\bf a}](x_i) = -\sum_{i=0}^m \nabla_{\bf a} \left(\log\pi\circ T_k[{\bf a}](x_i) + \log\partial_{x_k}T_k[{\bf a}](x_i)\right)$$

Parameters: f (ProductDistributionParametricPullbackComponentFunction) – function $$f$$ params (dict) – parameters for function $$f$$ cache (dict) – cached values x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi_1}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi_1}$$ batch_size (int) – this is the size of the batch to evaluated for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. (Note: if nprocs > 1, then the batch size defines the size of the batch for each process) mpi_pool (mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of f (float) – value
TransportMaps.hess_a_kl_divergence_component(f, params=None, cache=None, x=None, w=None, batch_size=None, mpi_pool=None)[source]

Compute $$-\sum_{i=0}^m \nabla^2_{\bf a}f[{\bf a}](x_i) = -\sum_{i=0}^m \nabla^2_{\bf a} \left(\log\pi\circ T_k[{\bf a}](x_i) + \log\partial_{x_k}T_k[{\bf a}](x_i)\right)$$

Parameters: f (ProductDistributionParametricPullbackComponentFunction) – function $$f$$ params (dict) – parameters for function $$f$$ cache (dict) – cached values x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi_1}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi_1}$$ batch_size (int) – this is the size of the batch to evaluated for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. (Note: if nprocs > 1, then the batch size defines the size of the batch for each process) mpi_pool (mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of f (float) – value
TransportMaps.misfit_squared(f1, f2, x, params1=None, params2=None, idxs_slice=None)[source]

Compute $$\vert f_1 - f_2 \vert^2$$

Parameters: f1 (Function or ndarray [$$m$$]) – function $$f_1$$ or its functions values f2 (Function or ndarray [$$m$$]) – function $$f_2$$ or its functions values x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi}$$ params1 (dict) – parameters for function $$f_1$$ params2 (dict) – parameters for function $$f_2$$ idxs_slice (slice) – slice of points to be (ndarray) – misfit $$\vert f_1 - f_2 \vert^2$$
TransportMaps.grad_a_misfit_squared(f1, f2, x, params1=None, params2=None, idxs_slice=None)[source]

Compute $$\nabla_{\bf a}\vert f_{1,{\bf a}} - f_2 \vert^2$$

Parameters: f1 (Function or ndarray [$$m$$]) – function $$f_1$$ or its functions values f2 (Function or ndarray [$$m$$]) – function $$f_2$$ or its functions values x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi}$$ params1 (dict) – parameters for function $$f_1$$ params2 (dict) – parameters for function $$f_2$$ idxs_slice (slice) – slice of points to be (ndarray) – misfit $$\nabla_{\bf a}\vert f_{1,{\bf a}} - f_2 \vert^2$$
TransportMaps.hess_a_misfit_squared(f1, f2, x, params1=None, params2=None, idxs_slice=None)[source]

Compute $$\nabla^2_{\bf a}\vert f_{1,{\bf a}} - f_2 \vert^2$$

Parameters: f1 (Function or ndarray [$$m$$]) – function $$f_1$$ or its functions values f2 (Function or ndarray [$$m$$]) – function $$f_2$$ or its functions values x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi}$$ params1 (dict) – parameters for function $$f_1$$ params2 (dict) – parameters for function $$f_2$$ idxs_slice (slice) – slice of points to be (ndarray) – misfit $$\nabla^2_{\bf a}\vert f_{1,{\bf a}} - f_2 \vert^2$$
TransportMaps.L2_misfit(*args, **kwargs)[source]

Compute $$\Vert f_1 - f_2 \Vert_{L^2_\pi}$$

Parameters: f1 (Function or ndarray [$$m$$]) – function $$f_1$$ or its functions values f2 (Function or ndarray [$$m$$]) – function $$f_2$$ or its functions values d (Distribution) – distribution $$\pi$$ params1 (dict) – parameters for function $$f_1$$ params2 (dict) – parameters for function $$f_2$$ qtype (int) – quadrature type to be used for the approximation of $$\mathbb{E}_{\pi}$$ qparams (object) – parameters necessary for the construction of the quadrature x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi}$$ batch_size (int) – this defines whether to evaluate in batches or not. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. (Note: if nprocs > 1, then the batch size defines the size of the batch for each process) mpi_pool (mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of f1 and f2 (float) – misfit $$\Vert f_1 - f_2 \Vert_{L^2_\pi}$$

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

TransportMaps.L2squared_misfit(f1, f2, d=None, params1=None, params2=None, qtype=None, qparams=None, x=None, w=None, batch_size=None, mpi_pool=None)[source]

Compute $$\Vert f_1 - f_2 \Vert^2_{L^2_\pi}$$

Parameters: f1 (Function or ndarray [$$m$$]) – function $$f_1$$ or its functions values f2 (Function or ndarray [$$m$$]) – function $$f_2$$ or its functions values d (Distribution) – distribution $$\pi$$ params1 (dict) – parameters for function $$f_1$$ params2 (dict) – parameters for function $$f_2$$ qtype (int) – quadrature type to be used for the approximation of $$\mathbb{E}_{\pi}$$ qparams (object) – parameters necessary for the construction of the quadrature x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi}$$ batch_size (int) – this defines whether to evaluate in batches or not. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. (Note: if nprocs > 1, then the batch size defines the size of the batch for each process) mpi_pool (mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of f1 and f2 (float) – misfit $$\Vert f_1 - f_2 \Vert^2_{L^2_\pi}$$

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

TransportMaps.grad_a_L2squared_misfit(f1, f2, d=None, params1=None, params2=None, qtype=None, qparams=None, x=None, w=None, batch_size=None, mpi_pool=None)[source]

Compute $$\nabla_{\bf a}\Vert f_{1,{\bf a}} - f_2 \Vert^2_{L^2_\pi}$$

Parameters: f1 (ParametricFunctionApproximation) – function $$f_1$$ f2 (Function or ndarray [$$m$$]) – function $$f_2$$ or its functions values d (Distribution) – distribution $$\pi$$ params1 (dict) – parameters for function $$f_1$$ params2 (dict) – parameters for function $$f_2$$ qtype (int) – quadrature type to be used for the approximation of $$\mathbb{E}_{\pi}$$ qparams (object) – parameters necessary for the construction of the quadrature x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi}$$ batch_size (int) – this defines whether to evaluate in batches or not. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. (Note: if nprocs > 1, then the batch size defines the size of the batch for each process) mpi_pool (mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of f1 and f2 (ndarray [$$N$$]) – misfit gradient $$\nabla_{\bf a}\Vert f_1 - f_2 \Vert_{L^2_\pi}$$

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

TransportMaps.hess_a_L2squared_misfit(f1, f2, d=None, params1=None, params2=None, qtype=None, qparams=None, x=None, w=None, batch_size=None, mpi_pool=None)[source]

Compute $$\nabla^2_{\bf a}\Vert f_{1,{\bf a}} - f_2 \Vert^2_{L^2_\pi}$$

Parameters: f1 (ParametricFunctionApproximation) – function $$f_1$$ f2 (Function or ndarray [$$m$$]) – function $$f_2$$ or its functions values d (Distribution) – distribution $$\pi$$ params1 (dict) – parameters for function $$f_1$$ params2 (dict) – parameters for function $$f_2$$ qtype (int) – quadrature type to be used for the approximation of $$\mathbb{E}_{\pi}$$ qparams (object) – parameters necessary for the construction of the quadrature x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi}$$ batch_size (int) – this defines whether to evaluate in batches or not. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. (Note: if nprocs > 1, then the batch size defines the size of the batch for each process) mpi_pool (mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of f1 and f2 (ndarray [$$N,N$$]) – misfit Hessian $$\nabla^2_{\bf a}\Vert f_1 - f_2 \Vert_{L^2_\pi}$$

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

TransportMaps.storage_hess_a_L2squared_misfit(f1, f2, d=None, params1=None, params2=None, qtype=None, qparams=None, x=None, w=None, batch_size=None, mpi_pool=None)[source]

Assemble $$\nabla^2_{\bf a}\Vert f_{1,{\bf a}} - f_2 \Vert^2_{L^2_\pi}$$.

Parameters: f1 (ParametricFunctionApproximation) – function $$f_1$$ f2 (Function or ndarray [$$m$$]) – function $$f_2$$ or its functions values d (Distribution) – distribution $$\pi$$ params1 (dict) – parameters for function $$f_1$$ params2 (dict) – parameters for function $$f_2$$ qtype (int) – quadrature type to be used for the approximation of $$\mathbb{E}_{\pi}$$ qparams (object) – parameters necessary for the construction of the quadrature x (ndarray [$$m,d$$]) – quadrature points used for the approximation of $$\mathbb{E}_{\pi}$$ w (ndarray [$$m$$]) – quadrature weights used for the approximation of $$\mathbb{E}_{\pi}$$ batch_size (int) – this defines whether to evaluate in batches or not. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. (Note: if nprocs > 1, then the batch size defines the size of the batch for each process) mpi_pool (mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of f1 and f2 (None) – the result is stored in params1['hess_a_L2_misfit']

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

Note

the dictionary params1 must be provided

TransportMaps.action_stored_hess_a_L2squared_misfit(H, v)[source]

Evaluate the action of $$\nabla^2_{\bf a}\Vert f_{1,{\bf a}} - f_2 \Vert^2_{L^2_\pi}$$ on $$v$$.

Parameters: v (ndarray [$$N,N$$]) – vector $$v$$ v – Hessian $$\nabla^2_{\bf a}\Vert f_{1,{\bf a}} - f_2 \Vert^2_{L^2_\pi}$$ (ndarray [$$N$$]) – $$\langle\nabla^2_{\bf a}\Vert f_{1,{\bf a}} - f_2 \Vert^2_{L^2_\pi},v\rangle$$
TransportMaps.grad_t_kl_divergence(x, d1, d2, params1=None, params2=None, grad_x_tm=None, batch_size=None, mpi_pool_tuple=(None, None))[source]

Compute $$\nabla_T \mathcal{D}_{KL}(\pi_1, \pi_2(T))$$.

This corresponds to:

Parameters: d1 (Distribution) – distribution $$\pi_1$$ d2 (Distribution) – distribution $$\pi_2$$ params1 (dict) – parameters for distribution $$\pi_1$$ params2 (dict) – parameters for distribution $$\pi_2$$ grad_x_tm – optional argument passed if $$\nabla_x T(x)$$ has been already computed batch_size (int) – this is the size of the batch to evaluated for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. (Note: if nprocs > 1, then the batch size defines the size of the batch for each process) mpi_pool_tuple (tuple [2] of mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of d1 and d2

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

TransportMaps.grad_x_grad_t_kl_divergence(x, d1, d2, params1=None, params2=None, grad_x_tm=None, grad_t=None, batch_size=None, mpi_pool_tuple=(None, None))[source]

Compute $$\nabla_x \nabla_T \mathcal{D}_{KL}(\pi_1, \pi_2(T))$$.

This corresponds to:

Parameters: d1 (Distribution) – distribution $$\pi_1$$ d2 (Distribution) – distribution $$\pi_2$$ params1 (dict) – parameters for distribution $$\pi_1$$ params2 (dict) – parameters for distribution $$\pi_2$$ grad_x_tm – optional argument passed if $$\nabla_x T(x)$$ has been already computed grad_t – optional argument passed if the first variation has been already computed batch_size (int) – this is the size of the batch to evaluated for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. (Note: if nprocs > 1, then the batch size defines the size of the batch for each process) mpi_pool_tuple (tuple [2] of mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of d1 and d2

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

TransportMaps.tuple_grad_x_grad_t_kl_divergence(x, d1, d2, params1=None, params2=None, grad_x_tm=None, batch_size=None, mpi_pool_tuple=(None, None))[source]

Compute $$\nabla_x \nabla_T \mathcal{D}_{KL}(\pi_1, \pi_2(T))$$.

This corresponds to:

Parameters: d1 (Distribution) – distribution $$\pi_1$$ d2 (Distribution) – distribution $$\pi_2$$ params1 (dict) – parameters for distribution $$\pi_1$$ params2 (dict) – parameters for distribution $$\pi_2$$ grad_x_tm – optional argument passed if $$\nabla_x T(x)$$ has been already computed batch_size (int) – this is the size of the batch to evaluated for each iteration. A size 1 correspond to a completely non-vectorized evaluation. A size None correspond to a completely vectorized one. (Note: if nprocs > 1, then the batch size defines the size of the batch for each process) mpi_pool_tuple (tuple [2] of mpi_map.MPI_Pool) – pool of processes to be used for the evaluation of d1 and d2

Note

The parameters (qtype,qparams) and (x,w) are mutually exclusive, but one pair of them is necessary.

TransportMaps.laplace_approximation(pi, params=None, x0=None, tol=1e-05, ders=2, fungrad=False, hessact=False, hessact_rnd_eps=1e-05, hessact_ovsamp=10, hessact_pow_n=0)[source]

Compute the Laplace approximation of the distribution $$\pi$$.

Parameters: pi (Distribution) – distribution $$\pi$$ params (dict) – parameters for distribution $$\pi$$ tol (float) – tolerance to be used to solve the maximization problem. ders (int) – order of derivatives available for the solution of the optimization problem. 0 -> derivative free, 1 -> gradient, 2 -> hessian. fungrad (bool) – whether the distribution $$\pi$$ provide the method Distribution.tuple_grad_x_log_pdf() computing the evaluation and the gradient in one step. This is used only for ders>=1. hessact (bool) – whether the distribution $$\pi$$ provides the method Distribution.action_hess_x_log_pdf() computing the action of the Hessian on a vector. This is used only for ders==2 hessact_rnd_eps (float) – tolerance to be used in the pursue of a randomized low-rank approximation of the prior preconditioned Hessian of the log-likelihood hessact_pow_n (int) – number of power iterations to be used in the pursue of a randomized low-rank approximation of the prior preconditioned Hessian of the log-likelihood hessact_ovsamp (int) – oversampling to be used in the pursue of a randomized low-rank approximation of the prior preconditioned Hessian of the log-likelihood (GaussianDistribution) – Laplace approximation
TransportMaps.laplace_approximation_withBounds(pi, params=None, tol=1e-05, ders=2, disp=True, bounds=None)[source]

Compute the Laplace approximation of the distribution $$\pi$$.

Parameters: pi (Distribution) – distribution $$\pi$$ params (dict) – parameters for distribution $$\pi$$ tol (float) – tolerance to be used to solve the maximization problem. ders (int) – order of derivatives available for the solution of the optimization problem. 0 -> derivative free, 1 -> gradient, 2 -> hessian. disp (bool) – whether to display output from optimizer. (GaussianDistribution) – Laplace approximation
TransportMaps.maximum_likelihood(logL, params=None, x0=None, tol=1e-05, ders=2, fungrad=False)[source]

Compute the maximum likelihood of the log-likelihood $$\log\pi({\bf y}\vert{\bf x})$$.

Parameters: logL (LogLikelihood) – log-likelihood $$\log\pi({\bf y}\vert{\bf x})$$ params (dict) – parameters for the log-likelihood $$\log\pi({\bf y}\vert{\bf x})$$ tol (float) – tolerance to be used to solve the maximization problem ders (int) – order of derivatives available for the solution of the optimization problem. 0 -> derivative free, 1 -> gradient, 2 -> hessian fungrad (bool) – whether the distributions $$\pi_1,\pi_2$$ provide the method Distribution.tuple_grad_x_log_pdf() computing the evaluation and the gradient in one step. This is used only for ders==1 (ndarray) – Maximum likelihood estimator
TransportMaps.Default_IsotropicIntegratedExponentialTriangularTransportMap(dim, order, span='total', active_vars=None, btype='poly', common_basis_flag=True)[source]

Generate a triangular transport map with default settings.

Parameters: dim (int) – dimension $$d$$ of the map order (int) – isotropic order of the map span (str) – ‘full’ for full order approximations, ‘total’ for total order approximations. If a list of dim strings is provided, these will define the approximation type fore each component $$T^{(k)}$$. active_vars (list) – list of $$d$$ lists containing the row sparsity pattern of the transport, i.e. the active variables for each component. Default None will generate a full triangular map. btype (string) – poly uses Hermite polynomials, fun uses Hermite functions, rbf uses radial basis functions. If a list of dim strings is provided, these will define the basis type fore each component $$T^{(k)}$$. common_basis_flag (bool) – use acceleration provided by common basis among the components (span and btype must be a string or a list with all equal elements). (IntegratedExponentialTriangularTransportMap) – the constructed transport map
TransportMaps.Default_IsotropicIntegratedExponentialDiagonalTransportMap(dim, order, btype='poly', *arg, **kwargs)[source]

Generate a diagonal transport map with default settings.

Parameters: dim (int) – dimension $$d$$ of the map order (int) – isotropic order of the map btype (string) – poly uses Hermite polynomials, fun uses Hermite functions, rbf uses radial basis functions. If a list of dim strings is provided, these will define the basis type fore each component $$T^{(k)}$$. (IntegratedExponentialTriangularTransportMap) – the constructed transport map
TransportMaps.Default_IsotropicIntegratedSquaredTriangularTransportMap(dim, order, span='total', active_vars=None, btype='poly', common_basis_flag=False)[source]

Generate a triangular transport map with default settings.

Parameters: dim (int) – dimension $$d$$ of the map order (int) – isotropic order of the map span (str) – ‘full’ for full order approximations, ‘total’ for total order approximations. If a list of dim strings is provided, these will define the approximation type fore each component $$T^{(k)}$$. active_vars (list) – list of $$d$$ lists containing the row sparsity pattern of the transport, i.e. the active variables for each component. Default None will generate a full triangular map. btype (string) – poly uses Hermite polynomials, fun uses Hermite functions, rbf uses radial basis functions. If a list of dim strings is provided, these will define the basis type fore each component $$T^{(k)}$$. common_basis_flag (bool) – use acceleration provided by common basis among the components (span and btype must be a string or a list with all equal elements). (IntegratedSquaredTriangularTransportMap) – the constructed transport map
TransportMaps.Default_IsotropicIntegratedSquaredDiagonalTransportMap(dim, order, btype='poly', *arg, **kwargs)[source]

Generate a diagonal transport map with default settings.

Parameters: dim (int) – dimension $$d$$ of the map order (int) – isotropic order of the map btype (string) – poly uses Hermite polynomials, fun uses Hermite functions, rbf uses radial basis functions. If a list of dim strings is provided, these will define the basis type fore each component $$T^{(k)}$$. (IntegratedSquaredTriangularTransportMap) – the constructed transport map
TransportMaps.Default_IsotropicMonotonicLinearSpanTriangularTransportMap(dim, order, span='total', active_vars=None, btype='poly', common_basis_flag=True)[source]

Generate a triangular transport map with default settings.

Parameters: dim (int) – dimension of the map order (int) – isotropic order of the map span (str) – ‘full’ for full order approximations, ‘total’ for total order approximations. If a list of dim strings is provided, these will define the approximation type fore each component $$T^{(k)}$$. active_vars (list) – list of $$d$$ lists containing the row sparsity pattern of the transport, i.e. the active variables for each component. Default None will generate a full triangular map. btype (string) – poly uses Hermite polynomials, fun uses Hermite functions, rbf uses radial basis functions. If a list of dim strings is provided, these will define the basis type fore each component $$T^{(k)}$$. common_basis_flag (bool) – use acceleration provided by common basis among the components (span and btype must be a string or a list with all equal elements). (LinearSpanTriangularTransportMap) – the constructed transport map
TransportMaps.Default_IsotropicLinearSpanTriangularTransportMap(dim, order, span='total', active_vars=None, btype='poly', common_basis_flag=True, monotone=False)[source]

Generate a triangular transport map with default settings.

Parameters: dim (int) – dimension of the map order (int) – isotropic order of the map span (str) – ‘full’ for full order approximations, ‘total’ for total order approximations. If a list of dim strings is provided, these will define the approximation type fore each component $$T^{(k)}$$. active_vars (list) – list of $$d$$ lists containing the row sparsity pattern of the transport, i.e. the active variables for each component. Default None will generate a full triangular map. btype (string) – poly uses Hermite polynomials, fun uses Hermite functions, rbf uses radial basis functions. If a list of dim strings is provided, these will define the basis type fore each component $$T^{(k)}$$. common_basis_flag (bool) – use acceleration provided by common basis among the components (span and btype must be a string or a list with all equal elements). (LinearSpanTriangularTransportMap) – the constructed transport map
TransportMaps.Default_LinearSpanTriangularTransportMap(dim, midxs_list, active_vars, btype='poly', common_basis_flag=True)[source]

Generate a linear span triangular transport map with default settings and user defined sparsity and orders.

Parameters: dim (int) – dimension of the map midxs_list (list) – list of $$d$$ lists of multi-indices for each component active_vars (list) – list of $$d$$ lists containing the row sparsity pattern of the transport, i.e. the active variables for each component. btype (string) – poly uses Hermite polynomials, fun uses Hermite functions, rbf uses radial basis functions. If a list of dim strings is provided, these will define the basis type fore each component $$T^{(k)}$$. common_basis_flag (bool) – use acceleration provided by common basis among the components (btype must be a string or a list with all equal elements). (LinearSpanTriangularTransportMap) – the constructed transport map