pysolvegn.build_sigmoid_parametrization#

build_sigmoid_parametrization(lower, upper, *, sparse=False)[source]#

Build a parametrization that constrains parameters to a finite interval using a sigmoid transformation.

The transformation is defined component-wise as:

\[p_{out} = l + (u-l)\sigma(p_{in})\]

where:

\[\sigma(x) = \frac{1}{1 + \exp(-x)}\]

and \(l\) and \(u\) are respectively the lower and upper bounds.

Consequently:

\[l < p_{out} < u.\]

The Jacobian is diagonal:

\[\frac{\partial p_{out}}{\partial p_{in}} = (u-l)\sigma(p_{in})(1-\sigma(p_{in})).\]
Parameters:
  • lower (ArrayLike) – Lower bounds with shape (n_parameters,).

  • upper (ArrayLike) – Upper bounds with shape (n_parameters,).

  • sparse (bool, optional (default: False)) – If True, the diagonal Jacobian is a scipy.sparse.csr_matrix (n entries), otherwise a dense numpy.ndarray of shape (n, n). Use sparse=True for a large number of parameters.

Returns:

The resulting bounded parametrization.

Return type:

Parametrization