TransportMaps.Maps.Decomposable

Classes

Inheritance diagram of TransportMaps.Maps.Decomposable.LiftedTransportMap, TransportMaps.Maps.Decomposable.SequentialMarkovChainTransportMap
Class Description
LiftedTransportMap Given a map \(T\) of dimension \(d_\theta + 2 d_{\bf x}\), where \(d_\theta\) is the number of hyper-parameters and \(d_{\bf x}\) is the state dimension, lift it to a \(\hat{d}\) state dimensional map.
SequentialMarkovChainTransportMap Compose the lower triangular 1-lag smoothing maps into the smoothing map

Documentation

class TransportMaps.Maps.Decomposable.LiftedTransportMap(idx, tm, dim, hyper_dim)[source]

Given a map \(T\) of dimension \(d_\theta + 2 d_{\bf x}\), where \(d_\theta\) is the number of hyper-parameters and \(d_{\bf x}\) is the state dimension, lift it to a \(\hat{d}\) state dimensional map.

Let

\[\begin{split}T(\Theta, {\bf x}) = \begin{bmatrix} T^{(0)}(\Theta) \\ T^{(1)}(\Theta, {\bf x}) \\ \end{bmatrix}\end{split}\]

be the map to be lifted at index \(i\) into a \(\hat{d}\) dimensional map.

\[\begin{split}T_{\rm lift}(\Theta, {\bf x}) = \left[ \begin{array}{c} T^{(0)}(\theta) \\ x_{1} \\ \; \vdots \\ x_{i-1} \\ T^{(1)}(\theta, x_{i}, \ldots, x_{i+2 d_{\bf x}}) \\ x_{i+2d_{\bf x}+1} \\ \; \vdots \\ x_{\hat{d}} \end{array} \right]\end{split}\]
Parameters:
  • idx (int) – index where to lift \(T\)
  • tm (TransportMap) – transport map \(T\)
  • dim (int) – total dimension \(\hat{d}\)
  • hyper_dim (int) – number of hyper-parameters \(d_\theta\)
coeffs

Returns the actual value of the coefficients.

Returns:(ndarray [\(N\)]) – coefficients.
evaluate(x, precomp=None, idxs_slice=slice(None, None, 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 points
  • precomp (dict) – dictionary of precomputed values
  • idxs_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 match x.shape[0].
  • cache (dict) – cache
Returns:

(ndarray [\(m,d\)]) – transformed points

Raises:

ValueError – if \(d\) does not match the dimension of the transport map.

grad_x(x, precomp=None, idxs_slice=slice(None, None, None), cache=None)[source]

Compute \(\nabla_{\bf x} T({\bf x},{\bf a})\).

This is

\nabla_{\bf x} T({\bf x},{\bf a}) = \begin{bmatrix} \nabla_{\bf x} T_1({\bf x},{\bf a}) \\ \nabla_{\bf x} T_2({\bf x},{\bf a}) \\ \vdots \\ \nabla_{\bf x} T_d({\bf x},{\bf a}) \end{bmatrix}

for every evaluation point.

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points
  • precomp (dict) – dictionary of precomputed values
  • idxs_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 match x.shape[0].
Returns:

(ndarray [\(m,d,d\)]) – gradient matrices for every evaluation point.

Raises:

ValueError – if \(d\) does not match the dimension of the transport map.

grad_x_inverse(x, *args, **kwargs)[source]

[Abstract] Compute \(\nabla_{\bf x} T^{-1}({\bf x},{\bf a})\).

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points
  • precomp (dict) – dictionary of precomputed values
  • idxs_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 match x.shape[0].
Returns:

(ndarray [\(m,d,d\)]) – gradient matrices for every evaluation point.

Raises:

NotImplementedError – to be implemented in subclasses

grad_x_log_det_grad_x(x, precomp=None, idxs_slice=slice(None, None, None), cache=None)[source]

[Abstract] Compute: \(\nabla_{\bf x} \log \det \nabla_{\bf x} T({\bf x}, {\bf a})\)

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points
  • precomp (dict) – dictionary of precomputed values
  • idxs_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 match x.shape[0].
Returns:

(ndarray [\(m,d\)]) – \(\nabla_{\bf x} \log \det \nabla_{\bf x} T({\bf x}, {\bf a})\) at every evaluation point

See also

log_det_grad_x().

grad_x_log_det_grad_x_inverse(x, *args, **kwargs)[source]

[Abstract] Compute: \(\nabla_{\bf x} \log \det \nabla_{\bf x} T^{-1}({\bf x}, {\bf a})\)

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points
  • precomp (dict) – dictionary of precomputed values
  • idxs_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 match x.shape[0].
Returns:

(ndarray [\(m,d\)]) – \(\nabla_{\bf x} \log \det \nabla_{\bf x} T^{-1}({\bf x}, {\bf a})\) at every evaluation point

See also

log_det_grad_x().

hess_x(x, precomp=None, idxs_slice=slice(None, None, None), cache=None)[source]

Compute \(\nabla^2_{\bf x} T({\bf x},{\bf a})\).

This is the tensor

\[\left[\nabla^2_{\bf x} T({\bf x},{\bf a})\right]_{i,k,:,:} = \nabla^2_{\bf x} T_k({\bf x}^{(i)},{\bf a}^{(k)})\]
Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points
  • precomp (dict) – dictionary of precomputed values
  • idxs_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 match x.shape[0].
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.

hess_x_log_det_grad_x(x, precomp=None, idxs_slice=slice(None, None, None), cache=None)[source]

[Abstract] Compute: \(\nabla^2_{\bf x} \log \det \nabla_{\bf x} T({\bf x}, {\bf a})\)

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points
  • precomp (dict) – dictionary of precomputed values
  • idxs_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 match x.shape[0].
Returns:

(ndarray [\(m,d,d\)]) – \(\nabla^2_{\bf x} \log \det \nabla_{\bf x} T({\bf x}, {\bf a})\) at every evaluation point

hess_x_log_det_grad_x_inverse(x, *args, **kwargs)[source]

[Abstract] Compute: \(\nabla^2_{\bf x} \log \det \nabla_{\bf x} T^{-1}({\bf x}, {\bf a})\)

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points
  • precomp (dict) – dictionary of precomputed values
  • idxs_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 match x.shape[0].
Returns:

(ndarray [\(m,d,d\)]) – \(\nabla^2_{\bf x} \log \det \nabla_{\bf x} T^{-1}({\bf x}, {\bf a})\) at every evaluation point

inverse(x, *args, **kwargs)[source]

[Abstract] Compute: \(T^{-1}({\bf y},{\bf a})\)

Parameters:
  • y (ndarray [\(m,d\)]) – evaluation points
  • precomp (dict) – precomputed values
  • idxs_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 match x.shape[0].
Returns:

(ndarray [\(m,d\)]) – \(T^{-1}({\bf y},{\bf a})\) for every evaluation point

log_det_grad_x(x, precomp=None, idxs_slice=slice(None, None, None), cache=None)[source]

[Abstract] Compute: \(\log \det \nabla_{\bf x} T({\bf x}, {\bf a})\).

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points
  • precomp (dict) – dictionary of precomputed values
  • idxs_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 match x.shape[0].
Returns:

(ndarray [\(m\)]) – \(\log \det \nabla_{\bf x} T({\bf x}, {\bf a})\) at every evaluation point

log_det_grad_x_inverse(x, *args, **kwargs)[source]

[Abstract] Compute: \(\log \det \nabla_{\bf x} T^{-1}({\bf x}, {\bf a})\).

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points
  • precomp (dict) – dictionary of precomputed values
  • idxs_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 match x.shape[0].
Returns:

(ndarray [\(m\)]) – \(\log \det \nabla_{\bf x} T^{-1}({\bf x}, {\bf a})\) at every evaluation point

n_coeffs

Returns the total number of coefficients.

Returns:
(int) – total number \(N\) of
coefficients characterizing the map.
class TransportMaps.Maps.Decomposable.SequentialMarkovChainTransportMap(tm_list, hyper_dim)[source]

Compose the lower triangular 1-lag smoothing maps into the smoothing map

Parameters:
  • tm_list (list) – list of 1-lag smoothing lower triangular transport maps
  • nhyper (int) – number of hyper-parameters

Warning

this works only for one dimensional states! It will be extended for higher dimensional states in the future.