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