TransportMaps.Maps.ComponentwiseMapBase
¶
Module Contents¶
Classes¶
Map \(T({\bf x}) := [T_1({\bf x}_{{\bf j}_1}), \ldots, T_{d_y}({\bf x}_{{\bf j}_{d_y}})]^\top\), where \(T_i({\bf x}_{{\bf j}_i}):\mathbb{R}^{\text{dim}({\bf j}_i)}\rightarrow\mathbb{R}\). |
- class TransportMaps.Maps.ComponentwiseMapBase.ComponentwiseMap(**kwargs)[source]¶
Bases:
TransportMaps.Maps.MapBase.Map
Map \(T({\bf x}) := [T_1({\bf x}_{{\bf j}_1}), \ldots, T_{d_y}({\bf x}_{{\bf j}_{d_y}})]^\top\), where \(T_i({\bf x}_{{\bf j}_i}):\mathbb{R}^{\text{dim}({\bf j}_i)}\rightarrow\mathbb{R}\).
- precomp_evaluate(x, precomp=None, precomp_type='uni')[source]¶
Precompute necessary structures for the evaluation of \(T({\bf x})\)
Enriches the dictionaries in the
precomp
list if necessary.
- evaluate(x, precomp=None, idxs_slice=slice(None), cache=None)[source]¶
Evaluate the transport map at the points \({\bf x} \in \mathbb{R}^{m \times d}\).
- Parameters:
x (
ndarray
[\(m,d\)]) – evaluation pointsprecomp (
dict
) – dictionary of precomputed valuesidxs_slice (slice) – if precomputed values are present, this parameter indicates at which of the points to evaluate. The number of indices represented by
idxs_slice
must matchx.shape[0]
.cache (
dict
) – cache
- Returns:
(
ndarray
[\(m,d\)]) – transformed points- Raises:
ValueError – if \(d\) does not match the dimension of the transport map.
- precomp_grad_x(x, precomp=None, precomp_type='uni')[source]¶
Precompute necessary structures for the evaluation of \(\nabla_{\bf x}T({\bf x},{\bf a})\)
Enriches the dictionaries in the
precomp
list if necessary.
- grad_x(x, precomp=None, idxs_slice=slice(None), *args, **kwargs)[source]¶
Compute \(\nabla_{\bf x} T({\bf x})\).
This is
\nabla_{\bf x} T({\bf x},{\bf a}) = \begin{bmatrix} \nabla_{\bf x} T_1({\bf x}) \\ \nabla_{\bf x} T_2({\bf x}) \\ \vdots \\ \nabla_{\bf x} T_d({\bf x}) \end{bmatrix}for every evaluation point.
- Parameters:
- Returns:
(
ndarray
[\(m,d,d\)]) – gradient matrices for every evaluation point.- Raises:
ValueError – if \(d\) does not match the dimension of the transport map.
- precomp_hess_x(x, precomp=None, precomp_type='uni')[source]¶
Precompute necessary structures for the evaluation of \(\nabla^2_{\bf x}T({\bf x})\)
Enriches the dictionaries in the
precomp
list if necessary.
- hess_x(x, precomp=None, idxs_slice=slice(None), *args, **kwargs)[source]¶
Compute \(\nabla^2_{\bf x} T({\bf x})\).
This is the tensor
\[\left[\nabla^2_{\bf x} T({\bf x})\right]_{i,k,:,:} = \nabla^2_{\bf x} T_k({\bf x}^{(i)})\]- Parameters:
- Returns:
(
ndarray
[\(m,d,d,d\)]) – Hessian matrices for every evaluation point and every dimension.- Raises:
ValueError – if \(d\) does not match the dimension of the transport map.
- action_hess_x(x, dx, precomp=None, idxs_slice=slice(None), *args, **kwargs)[source]¶
Compute \(\langle\nabla^2_{\bf x} T({\bf x}),\delta{\bf x}\rangle\).
This is the tensor
\[\left[\nabla^2_{\bf x} T({\bf x})\right]_{i,k,:i} = \langle \nabla^2_{\bf x} T_k({\bf x}^{(i)}), \delta{\bf x}\rangle\]- Parameters:
x (
ndarray
[\(m,d\)]) – evaluation pointsdx (
ndarray
[\(m,d\)]) – direction on which to evaluate the Hessianprecomp (
dict
) – dictionary of precomputed valuesidxs_slice (slice) – if precomputed values are present, this parameter indicates at which of the points to evaluate. The number of indices represented by
idxs_slice
must matchx.shape[0]
.
- Returns:
(
ndarray
[\(m,d,d\)]) – Hessian matrices for every evaluation point and every dimension.- Raises:
ValueError – if \(d\) does not match the dimension of the transport map.