transform.mismatch_generator(prototype: Dict[str, bool], percent_deviation: float = 0.3, sigma_rule: float = 3.0) Callable[[Tuple[Dict[str, Array], Array]], Dict[str, Array]][source]

mismatch_generator returns a function which simulates the analog device mismatch effect. The function deviates the parameter values provided in statistical means. The calculation parameters should be based on statistical knowledge obtained from emprical observations. That is, if one observes up-to-30% mismatch between the expected current and the measured current actually flowing through the transistors: percent should be 0.30. Therefore, let’s say

mismatched current / actual current < %30 for 95 percent of the cases

Using gaussian distribution and statistics, we could obtain this. In statistics, the 68-95-99.7 rule, also known as the empirical rule, is a shorthand used to remember the percentage of values that lie within an interval estimate in a normal distribution: 68%, 95%, and 99.7% of the values lie within one, two, and three standard deviations of the mean, respectively.

\[\begin{split}Pr(\mu -1\sigma \leq X\leq \mu +1\sigma ) \approx 68.27\\ Pr(\mu -2\sigma \leq X\leq \mu +2\sigma ) \approx 95.45\\ Pr(\mu -3\sigma \leq X\leq \mu +3\sigma ) \approx 99.73\\\end{split}\]

So, to obtain β€˜mismatched current / actual current < %30 for 95 percent of the cases’, the sigma should be half of the maximum deviation desired. That is the 30% percent of the theoretical current value.

  • prototype (Dict[str, bool]) – the mismatch prototype. See devices.dynapse.frozen_mismatch_prototype(), and devices.dynapse.dynamic_mismatch_prototype()

  • percent_deviation (float, optional) – the maximum deviation percentage from the theoretical value, defaults to 0.30

  • sigma_rule (float, optional) – The sigma rule to use. if 1.0, then 68.27% of the values will deviate less then percent, if 2.0, then 95.45% of the values will deviate less then percent etc., defaults to 3.0


a function which takes a pytree and computes the mismatch amount accordingly

Return type:

Callable[ [Tuple[Dict[str, jax.Array], jax.Array]], Dict[str, jax.Array] ]