aihwkit.inference.noise.pcm module

Phenomenological noise models for PCM devices for inference.

class aihwkit.inference.noise.pcm.PCMLikeNoiseModel(prog_coeff=None, g_converter=None, g_max=None, t_read=2.5e-07, t_0=20.0, prog_noise_scale=1.0, read_noise_scale=1.0, drift_scale=1.0)[source]

Bases: aihwkit.inference.noise.base.BaseNoiseModel

Noise model that was fitted and characterized on real PCM devices.

Expected weight noise at assumed time of inference with expected programming noise at 0.

The statistical noise model is based on measured PCM devices.

Parameters
  • prog_coeff (Optional[List[float]]) – programming polynomial coeffs in \(\mu S\), c(0) + c(1)*gt + c(2)*gt^2)

  • g_converter (Optional[aihwkit.inference.converter.base.BaseConductanceConverter]) – instantiated class of the conductance converter (defaults to single pair)

  • g_max (Optional[float]) – In \(\mu S\), the maximal conductance, ie the value the absolute max of the weights will be mapped to.

  • t_read (float) – parameter of the 1/f fit (in seconds)

  • t_0 (float) –

    parameter of the drift fit (first reading time)

    Note

    The t_inference is relative to this time t0 e.g. t_inference counts from the completion of the programming of a device.

  • prog_noise_scale (float) – scale for the programming noise

  • read_noise_scale (float) – scale for the read and accumulated noise

  • drift_scale (float) – scale for the drift coefficient

apply_drift_noise_to_conductance(g_prog, nu_drift, t_inference)[source]

Apply the noise and drift up to the assumed inference time point based on PCM measurements.

Parameters
  • g_prog (torch.Tensor) –

  • nu_drift (torch.Tensor) –

  • t_inference (float) –

Return type

torch.Tensor

apply_programming_noise_to_conductance(g_target)[source]

Apply programming noise to a target conductance Tensor.

Programming noise with additive Gaussian noise with conductance dependency of the variance given by a 2-degree polynomial.

Parameters

g_target (torch.Tensor) –

Return type

torch.Tensor

generate_drift_coefficients(g_target)[source]

Return drift coefficients nu based on PCM measurements.

Parameters

g_target (torch.Tensor) –

Return type

torch.Tensor