pygsti.extras.drift.signal.renormalizer#
- renormalizer(p, method='logistic')#
Takes an arbitrary input vector p and maps it to a vector bounded within [0,1].
If method = “sharp”, then it maps any value in p below zero to zero and any value in p above one to one.
If method = “logistic” then it ‘squashes’ the vector around it’s mean value using a logistic function. The exact transform for each element x of p is:
x -> mean - nu + (2*nu) / (1 + exp(-2 * (x - mean) / nu))
where mean is the mean value of p, and nu is min(1-mean,mean). This transformation is only sensible when the mean of p is within [0,1].
- Parameters:
p (array of floats) – The vector with values to be mapped to [0,1]
method ({'logistic', 'sharp'}) – The method for “squashing” the input vector.
- Returns:
The input vector “squashed” using the specified method.
- Return type:
numpy.array