sigmoid

sofia_redux.toolkit.resampling.sigmoid(x, factor=1.0, offset=0.0)[source]

Evaluate a scaled and shifted logistic function.

The sigmoid function has the form:

\[f(x) = \frac{1}{1 + e^{\beta (x - \alpha)}}\]

where \(\beta\) is the scaling factor, and \(\alpha\) is an offset applied to x.

Parameters:
xint or float or numpy.ndarray (shape)

The independent variable. If an array is supplied, must be the same shape as factor and offset (if both/either are also arrays).

factorint or float or numpy.ndarray (shape)

The scaling factor applied to x. If an array is supplied, must be the same shape as x and offset (if both/either are also arrays).

offsetint or float or numpy.ndarray (shape)

The offset to applied to x. If an array is supplied, must be the same shape as x and factor (if both/either are also arrays).

Returns:
resultfloat or numpy.ndarray (shape)

The sigmoid function evaluated at x.