TransportMaps.Maps.AffineMapBase

Module Contents

Classes

AffineMap

Affine map \(T[{\bf c},{\bf L}]({\bf x})={\bf c} + {\bf L}{\bf x}\)

LinearMap

Affine map \(T[{\bf c},{\bf L}]({\bf x})={\bf c} + {\bf L}{\bf x}\)

class TransportMaps.Maps.AffineMapBase.AffineMap(**kwargs)[source]

Bases: TransportMaps.Maps.ParametricMapBase.ParametricMap

Affine map \(T[{\bf c},{\bf L}]({\bf x})={\bf c} + {\bf L}{\bf x}\)

property Linv[source]
property c[source]

The constant term \({\bf c}\)

property L[source]

The linear term \({\bf L}\)

property coeffs[source]

Returns the constant and linear term of the linear map.

Returns:

(ndarray) –

flattened array of coefficients

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

Evaluate the map at the points \({\bf x} \in \mathbb{R}^{m \times d_{\text{in}}}\).

Parameters:

x (ndarray [\(m,d_{\text{in}}\)]) – evaluation points

Returns:

(ndarray [\(m,d_{\text{out}}\)]) – transformed points

Raises:

ValueError – if \(d_{\text{in}}\) does not match the dimension of the transport map.

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

Evaluate the gradient (constant for linear maps)

Parameters:

x (ndarray [\(m,d_{\text{in}}\)]) – evaluation points

Returns:

(ndarray [\(m, d_{\text{out}},d_{\text{in}}\)]) –

gradient matrix (constant at every evaluation point).

Raises:

ValueError – if \(d_{\text{in}}\) does not match the dimension of the transport map.

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

Evaluate the function and gradient (constant for linear maps)

Parameters:

x (ndarray [\(m,d_{\text{in}}\)]) – evaluation points

Returns:

(tuple) –

function and gradient matrices .

Raises:

ValueError – if \(d_{\text{in}}\) does not match the dimension of the transport map.

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

Evaluate the Hessian for the linear map (zero)

Parameters:

x (ndarray [\(m,d_{\text{in}}\)]) – evaluation points

Returns:

(ndarray [\(m,d_{\text{out},d_{\text{in}},d_{\text{in}}\)]) – Hessian matrix (zero everywhere).

Raises:

ValueError – if \(d_{\text{in}}\) does not match the dimension of the transport map.

action_hess_x(x, dx, *args, **kwargs)[source]

Evaluate the action of the Hessian for the linear map (zero)

Parameters:
  • x (ndarray [\(m,d_{\text{in}}\)]) – evaluation points

  • dx (ndarray [\(m,d_{\text{in}}\)]) – direction on which to evaluate the Hessian

Returns:

(ndarray [\(m,d_{\text{out}},d_{\text{in}}\)]) –

action of the Hessian matrix (zero everywhere).

Raises:

ValueError – if \(d_{\text{in}}\) does not match the dimension of the transport map.

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

Compute the pseudoinverse map \(\hat{T}^{-1}({\bf y},{\bf a})\)

Parameters:

y (ndarray [\(m,d\)]) – evaluation points

Returns:

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

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

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

Parameters:

x (ndarray [\(m,d\)]) – evaluation points

Returns:

(ndarray [\(d,d\)]) – gradient matrix (constant at every evaluation point).

Raises:

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

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

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

Parameters:

x (ndarray [\(m,d\)]) – evaluation points

Returns:

(ndarray [\(d,d,d\)]) – Hessian matrix (zero everywhere).

Raises:

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

action_hess_x_inverse(x, dx, *args, **kwargs)[source]

Compute \(\langle\nabla^2_{\bf x} \hat{T}^{-1}({\bf x},{\bf a}), \delta{\bf x}\rangle\).

Parameters:
  • x (ndarray [\(m,d\)]) – evaluation points

  • dx (ndarray [\(m,d\)]) – direction on which to evaluate the Hessian

Returns:

(ndarray [\(d,d\)]) – action of Hessian matrix (zero everywhere).

Raises:

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

class TransportMaps.Maps.AffineMapBase.LinearMap(c, L, Linv=None)[source]

Bases: AffineMap

Affine map \(T[{\bf c},{\bf L}]({\bf x})={\bf c} + {\bf L}{\bf x}\)