# TransportMaps.Maps.InverseMapBase¶

## Module Contents¶

### Classes¶

 InverseMap Defines the map $$S := T^{\dagger}$$
class TransportMaps.Maps.InverseMapBase.InverseMap(**kwargs)[source]

Defines the map $$S := T^{\dagger}$$

property base_map[source]
get_ncalls_tree(indent='')[source]
get_nevals_tree(indent='')[source]
get_teval_tree(indent='')[source]
update_ncalls_tree(obj)[source]
update_nevals_tree(obj)[source]
update_teval_tree(obj)[source]
reset_counters()[source]
evaluate(x, precomp=None, idxs_slice=slice(None), *args, **kwargs)[source]

Evaluate the map $$T^{-1}$$ 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].

Returns:

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

Raises:

ValueError – if $$d$$ does not match the dimension of the transport map.

[Abstract] Evaluate the gradient $$\nabla_{\bf x}T$$ at the points $${\bf x} \in \mathbb{R}^{m \times d_x}$$.

Parameters:
• x (ndarray [$$m,d_x$$]) – 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_y,d_x$$]) – transformed points

Raises:

NotImplementedError – to be implemented in sub-classes

[Abstract] Evaluate the function and gradient.

Parameters:
• x (ndarray [$$m,d_x$$]) – 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:

(tuple) – function and gradient evaluation

Raises:

NotImplementedError – to be implemented in sub-classes

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

[Abstract] Evaluate the Hessian $$\nabla^2_{\bf x}T$$ at the points $${\bf x} \in \mathbb{R}^{m \times d_x}$$.

Parameters:
• x (ndarray [$$m,d_x$$]) – 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_y,d_x,d_x$$]) – transformed points

Raises:

NotImplementedError – to be implemented in sub-classes

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

[Abstract] Evaluate the action of the Hessian $$\langle\nabla^2_{\bf x}T,\delta{\bf x}\rangle$$ at the points $${\bf x} \in \mathbb{R}^{m \times d_x}$$.

Parameters:
• x (ndarray [$$m,d_x$$]) – evaluation points

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

• 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_y,d_x$$]) – transformed points

Raises:

NotImplementedError – to be implemented in sub-classes

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

Evaluates $$T$$

Parameters:

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

Returns:

(ndarray [$$m,d$$]) – $$T({\bf x})$$ for every evaluation point

Evaluates $$\nabla_{\bf x}T$$

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.

[Abstract] Evaluate the Moore-Penrose inverse function and gradient.

Parameters:
• x (ndarray [$$m,d_x$$]) – 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:

(tuple) – function and gradient evaluation

Raises:

NotImplementedError – to be implemented in sub-classes

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

Evaluates $$\nabla^2_{\bf x}T$$

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_inverse(x, *args, **kwargs)[source]

[Abstract] Evaluate the action of the Hessian of the Moore-Penrose inverse $$\langle\nabla^2_{\bf x}T^\dagger,\delta{\bf x}\rangle$$ at the points $${\bf x} \in \mathbb{R}^{m \times d_x}$$.

Parameters:
• x (ndarray [$$m,d_x$$]) – evaluation points

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

• 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_y,d_x$$]) – transformed points

Raises:

NotImplementedError – to be implemented in sub-classes