Renormalise#

class hypercoil.init.mapparam.Renormalise[source]#

Normalise entries in the specified tensor so that all are in an interval specified by bounds.

Note that this handler is in general much more radical than clipping. In particular, if any entry at all is out of bounds, nearly all entries in the tensor will be edited, and a single extreme outlier can destroy the variance in the dataset. If you are considering using this because most of the data you expect to see will be outside of the prescribed domain, consider using a different domain first (for instance, using the scale parameter to accommodate a larger feasible interval).

The normalisation procedure works by mapping the original range of observations, [obs_min, obs_max], to [max(obs_min, lbound), min(obs_max, ubound)] while preserving relative distances between observations.

Methods

apply(x, bound[, axis])

Re-scale all values in the specified tensor to fall in the specified interval.