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 anoffset
applied tox
.- Parameters:
- xint or float or numpy.ndarray (shape)
The independent variable. If an array is supplied, must be the same shape as
factor
andoffset
(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 asx
andoffset
(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 asx
andfactor
(if both/either are also arrays).
- Returns:
- resultfloat or numpy.ndarray (shape)
The sigmoid function evaluated at
x
.