TransportMaps.Maps.MapBase
¶
Module Contents¶
Classes¶
Abstract map \(T:\mathbb{R}^{d_x}\rightarrow\mathbb{R}^{d_y}\) |
- class TransportMaps.Maps.MapBase.Map(**kwargs)[source]¶
Bases:
TransportMaps.ObjectBase.TMO
Abstract map \(T:\mathbb{R}^{d_x}\rightarrow\mathbb{R}^{d_y}\)
- __call__(x)[source]¶
Calls
evaluate()
.
- abstract evaluate(x, precomp=None, idxs_slice=slice(None), **kwargs)[source]¶
[Abstract] Evaluate the map \(T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract grad_x(x, precomp=None, idxs_slice=slice(None), **kwargs)[source]¶
[Abstract] Evaluate the gradient \(\nabla_{\bf x}T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract action_grad_x(x, dx, precomp=None, idxs_slice=slice(None), **kwargs)[source]¶
[Abstract] Evaluate the action of the gradient \(\langle\nabla_{\bf x}T({\bf x}),\delta{\bf x}\rangle\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\) on the vector \(\delta{\bf x}\).
- Parameters:
x (
ndarray
[\(m,d_x\)]) – evaluation pointsdx (
ndarray
[\(m,d_x,...\)]) – vector \(\delta{\bf x}\)precomp (
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_y,...\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract action_adjoint_grad_x(x, dx, precomp=None, idxs_slice=slice(None), **kwargs)[source]¶
[Abstract] Evaluate the action of the gradient \(\langle\delta{\bf x},\nabla_{\bf x}T({\bf x})\rangle\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\) on the vector \(\delta{\bf x}\).
- Parameters:
x (
ndarray
[\(m,d_x\)]) – evaluation pointsdx (
ndarray
[\(m,d_x,...\)]) – vector \(\delta{\bf x}\)precomp (
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_y,...\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract tuple_grad_x(x, precomp=None, idxs_slice=slice(None), **kwargs)[source]¶
[Abstract] Evaluate the function and gradient.
- Parameters:
- Returns:
(
tuple
) – function and gradient evaluation- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract action_tuple_grad_x(x, dx, precomp=None, idxs_slice=slice(None), **kwargs)[source]¶
[Abstract] Evaluate the function and action of the gradient.
- Parameters:
x (
ndarray
[\(m,d_x\)]) – evaluation pointsdx (
ndarray
[\(m,d_x,...\)]) – vector \(\delta{\bf x}\)precomp (
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:
(
tuple
) – function and action of the gradient evaluation- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract hess_x(x, precomp=None, idxs_slice=slice(None), **kwargs)[source]¶
[Abstract] Evaluate the Hessian \(\nabla^2_{\bf x}T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y,d_x,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract action_hess_x(x, dx, precomp=None, idxs_slice=slice(None), **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 pointsdx (
ndarray
[\(m,d_x\)]) – 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_y,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract inverse(x, precomp=None, idxs_slice=slice(None), **kwargs)[source]¶
[Abstract] Evaluate the Moore-Penrose inverse map \(T^\dagger\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract grad_x_inverse(x, precomp=None, idxs_slice=slice(None), **kwargs)[source]¶
[Abstract] Evaluate the gradient of the Moore-Penrose inverse \(\nabla_{\bf x}T^\dagger\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract tuple_grad_x_inverse(x, precomp=None, idxs_slice=slice(None), **kwargs)[source]¶
[Abstract] Evaluate the Moore-Penrose inverse function and gradient.
- Parameters:
- Returns:
(
tuple
) – function and gradient evaluation- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract hess_x_inverse(x, precomp=None, idxs_slice=slice(None), **kwargs)[source]¶
[Abstract] Evaluate the Hessian of the Moore-Penrose inverse \(\nabla^2_{\bf x}T^\dagger\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y,d_x,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- abstract action_hess_x_inverse(x, dx, precomp=None, idxs_slice=slice(None), **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 pointsdx (
ndarray
[\(m,d_x\)]) – 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_y,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes