aihwkit.inference.noise.pcm module
Phenomenological noise models for PCM devices for inference.
- class aihwkit.inference.noise.pcm.CustomDriftPCMLikeNoiseModel(custom_drift_model, 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, prog_coeff_g_max_reference=None)[source]
Bases:
PCMLikeNoiseModelEnables user-defined (custom) drift models.
- Parameters:
custom_drift_model (dict) – drift model specified as a dictionary containing three lists: g_lst, a list of conductances in ascending order; nu_mean_lst, a list of mean drift coefficients corresponding to the g_lst values; and nu_std_lst, a list of nu standard deviation values corresponding to the g_lst values.
prog_coeff (List[float] | None) – Programming polynomial coeffs in \(\sum_i c_i \left(\frac{g_t}{g_\max}\right)^i\)
g_converter (BaseConductanceConverter | None) – instantiated class of the conductance converter (defaults to single pair)
g_max (float | None) – 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_inferenceis 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.
prog_coeff_g_max_reference (float | None) – reference \(g_\max\) value when fitting the coefficients, since the result of the polynomial fit is given in uS. If
prog_coeff_g_max_referenceis not given and prog_coeffs are given explicitly, it will be set tog_maxof the conductance converter.
- 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, prog_coeff_g_max_reference=None)[source]
Bases:
BaseNoiseModelNoise 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. See also Nandakumar et al. ICECS (2019)
- Parameters:
prog_coeff (List[float] | None) – Programming polynomial coeffs in \(\sum_i c_i \left(\frac{g_t}{g_\max}\right)^i\)
g_converter (BaseConductanceConverter | None) – instantiated class of the conductance converter (defaults to single pair)
g_max (float | None) – 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_inferenceis 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.
prog_coeff_g_max_reference (float | None) – reference \(g_\max\) value when fitting the coefficients, since the result of the polynomial fit is given in uS. If
prog_coeff_g_max_referenceis not given and prog_coeffs are given explicitly, it will be set tog_maxof the conductance converter.
- apply_drift_noise_to_conductance(g_prog, drift_noise_param, t_inference)[source]
Apply the noise and drift up to the assumed inference time point based on PCM measurements.
- Parameters:
g_prog (Tensor)
drift_noise_param (Tensor)
t_inference (float)
- Return type:
Tensor