TransportMaps.Maps.ConstantMapBase

Module Contents

Classes

ConstantMap

Map \(T({\bf x})={\bf c}\)

class TransportMaps.Maps.ConstantMapBase.ConstantMap(dim_in, const)[source]

Bases: TransportMaps.Maps.ParametricMapBase.ParametricMap

Map \(T({\bf x})={\bf c}\)

Parameters:
  • dim_in (int) – input dimension \(d_x\)

  • const (ndarray [\(d_y\)]) – constant \({\bf c}\)

property coeffs[source]

Returns the actual value of the coefficients.

Returns:

(ndarray [\(N\)]) – coefficients.

Raises:

NotImplementedError – needs to be implemented in subclasses

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

[Abstract] Evaluate the map \(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\)]) – transformed points

Raises:

NotImplementedError – to be implemented in sub-classes

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

[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

hess_x(x, precomp=None, idxs_slice=slice(None))[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