def stationary_nonlinearity(self, stim):
"""Stationary nonlinearity
Nonlinearly rescale a temporal signal `stim` across space and time,
based on a sigmoidal function dependent on the maximum value of `stim`.
This is Box 4 in Nanduri et al. (2012).
The parameter values of the asymptote, slope, and shift of the logistic
function are given by self.asymptote, self.slope, and self.shift,
respectively.
Parameters
----------
stim: array
Temporal signal to process, stim(r, t) in Nanduri et al. (2012).
Returns
-------
Rescaled signal, b4(r, t) in Nanduri et al. (2012).
Notes
-----
Conversion to TimeSeries is avoided for the sake of speedup.
"""
# use expit (logistic) function for speedup
sigmoid = ss.expit((stim.max() - self.shift) / self.slope)
return stim * sigmoid
评论列表
文章目录