aihwkit.simulator.configs.devices module
Configuration for NVM devices for Analog (Resistive Device) tiles.
- class aihwkit.simulator.configs.devices.ConstantStepDevice(construction_seed=0, corrupt_devices_prob=0.0, corrupt_devices_range=0.1, diffusion=0.0, diffusion_dtod=0.0, drift=<factory>, dw_min=0.001, dw_min_dtod=0.3, dw_min_dtod_log_normal=False, dw_min_std=0.3, enforce_consistency=True, lifetime=0.0, lifetime_dtod=0.0, perfect_bias=False, reset=0.0, reset_dtod=0.0, reset_std=0.01, up_down=0.0, up_down_dtod=0.01, w_max=0.6, w_max_dtod=0.3, w_min=-0.6, w_min_dtod=0.3, count_pulses=False)[source]
Bases:
PulsedDevice
Pulsed update behavioral model: constant step.
Pulsed update behavioral model, where the update step of material is constant throughout the resistive range (up to hard bounds).
In more detail, the update behavior implemented for
ConstantStep
is:\[ \begin{align}\begin{aligned}w_{ij} &\leftarrow& w_{ij} - \Delta w_{ij}^d(1 + \sigma_\text{c-to-c}\,\xi)\\w_{ij} &\leftarrow& \text{clip}(w_{ij},b^\text{min}_{ij},b^\text{max}_{ij})\end{aligned}\end{align} \]where \(d\) is the direction of the update (product of signs of input and error). \(\Delta w_{ij}^d\) is the update step size of the cross-point ij in direction \(d\) (up or down). Note that each cross-point has separate update sizes so that device-to-device fluctuations and biases in the directions can be given.
Moreover, the clipping bounds of each cross-point ij (i.e. \(b_{ij}^\text{max/min}\)) are also different in general. The mean and the amount of systematic spread from device-to-device can be given as parameters, see below.
For parameters regarding the devices settings, see e.g.
PulsedDevice
.- Parameters:
construction_seed (int) –
corrupt_devices_prob (float) –
corrupt_devices_range (float) –
diffusion (float) –
diffusion_dtod (float) –
drift (DriftParameter) –
dw_min (float) –
dw_min_dtod (float) –
dw_min_dtod_log_normal (bool) –
dw_min_std (float) –
enforce_consistency (bool) –
lifetime (float) –
lifetime_dtod (float) –
perfect_bias (bool) –
reset (float) –
reset_dtod (float) –
reset_std (float) –
up_down (float) –
up_down_dtod (float) –
w_max (float) –
w_max_dtod (float) –
w_min (float) –
w_min_dtod (float) –
count_pulses (bool) –
- class aihwkit.simulator.configs.devices.ExpStepDevice(construction_seed=0, corrupt_devices_prob=0.0, corrupt_devices_range=0.1, diffusion=0.0, diffusion_dtod=0.0, drift=<factory>, dw_min=0.001, dw_min_dtod=0.3, dw_min_dtod_log_normal=False, dw_min_std=0.3, enforce_consistency=True, lifetime=0.0, lifetime_dtod=0.0, perfect_bias=False, reset=0.0, reset_dtod=0.0, reset_std=0.01, up_down=0.0, up_down_dtod=0.01, w_max=0.6, w_max_dtod=0.3, w_min=-0.6, w_min_dtod=0.3, count_pulses=False, A_up=0.00081, A_down=0.36833, gamma_up=12.44625, gamma_down=12.78785, a=0.244, b=0.2425, dw_min_std_add=0.0, dw_min_std_slope=0.0, write_noise_std=0.0, apply_write_noise_on_set=True)[source]
Bases:
PulsedDevice
Exponential update step or CMOS-like update behavior.
This model is derived from
PulsedDevice
and uses all its parameters.ExpStepDevice
only implements a new ‘update once’ functionality, where the minimal weight step change with weight is fitted by an exponential function as detailed below.\[w_{ij} \leftarrow w_{ij} - \max(y_{ij},0) \Delta w_{ij}^d (1 + \sigma_\text{c-to-c}\,\xi)\]and \(y_{ij}\) is given as
\[ \begin{align}\begin{aligned}z_{ij} = 2 a_\text{es} \frac{w_{ij}}{b^\text{max}_{ij} - b^\text{min}_{ij}} + b_\text{es}\\y_{ij} = 1 - A^{(d)} e^{d \gamma^{(d)} z_{ij}}\end{aligned}\end{align} \]where \(d\) is the direction of the update (+ or -), see also
PulsedDevice
for details.All additional parameter (\(a_\text{es}\), \(b_\text{es}\), \(\gamma^{(d)}\), \(A^{(d)}\) ) are tile-wise fitting parameters (ie. no device-to-device variation in these parameters). Note that the other parameter involved can be still defined with device-to-device variation and (additional) up-down bias (see
PulsedDevice
).Note
This device also features a more complex cycle-to-cycle noise model of the update step, when specifying
dw_min_std_add
anddw_min_std_slope
. By default, The Gaussian noise added to the calculated update step size \(\Delta q_\text{act}\) is proportional to\[\sigma_{\text{final}} = \sigma \left( \sigma_\text{add} + |\Delta w_\text{actual}| + \sigma_\text{slope} |w_\text{current}|\right)\]where the \(\sigma\) is given by
dw_min_std
, \(\sigma_\text{add}\) is given bydw_min_std_add
, and \(\sigma_\text{slope}\) is given bydw_min_std_slope
.- Parameters:
construction_seed (int) –
corrupt_devices_prob (float) –
corrupt_devices_range (float) –
diffusion (float) –
diffusion_dtod (float) –
drift (DriftParameter) –
dw_min (float) –
dw_min_dtod (float) –
dw_min_dtod_log_normal (bool) –
dw_min_std (float) –
enforce_consistency (bool) –
lifetime (float) –
lifetime_dtod (float) –
perfect_bias (bool) –
reset (float) –
reset_dtod (float) –
reset_std (float) –
up_down (float) –
up_down_dtod (float) –
w_max (float) –
w_max_dtod (float) –
w_min (float) –
w_min_dtod (float) –
count_pulses (bool) –
A_up (float) –
A_down (float) –
gamma_up (float) –
gamma_down (float) –
a (float) –
b (float) –
dw_min_std_add (float) –
dw_min_std_slope (float) –
write_noise_std (float) –
apply_write_noise_on_set (bool) –
- A_down: float = 0.36833
Factor
A
for the down direction.
- A_up: float = 0.00081
Factor
A
for the up direction.
- a: float = 0.244
Global slope parameter.
- apply_write_noise_on_set: bool = True
Whether setting the weights with
set_weights
will add write noise to the apparent weight state or not.If
False
the persistent weight state will be equal to the apparent state initially.
- b: float = 0.2425
Global offset parameter.
- dw_min_std_add: float = 0.0
additive cycle-to-cycle noise of the update size (in units of
dw_min_std
, see above).
- dw_min_std_slope: float = 0.0
cycle-to-cycle noise of the update size (in units of
dw_min_std
, see above).
- gamma_down: float = 12.78785
Exponent for the down direction.
- gamma_up: float = 12.44625
Exponent for the up direction.
- write_noise_std: float = 0.0
Whether to use update write noise.
Whether to use update write noise that is added to the updated devices weight, while the update is done on a hidden persistent weight. The update write noise is then sampled a new when the device is touched again.
Thus it is:
\[w_\text{apparent}{ij} = w_{ij} + \sigma_\text{write_noise}\xi\]and the update is done on \(w_{ij}\) but the forward sees the \(w_\text{apparent}\).
- class aihwkit.simulator.configs.devices.FloatingPointDevice(diffusion=0.0, lifetime=0.0, drift=<factory>)[source]
Bases:
_PrintableMixin
Floating point reference.
Implements ideal devices forward/backward/update behavior.
- Parameters:
diffusion (float) –
lifetime (float) –
drift (SimpleDriftParameter) –
- as_bindings(data_type)[source]
Return a representation of this instance as a simulator bindings object.
- Parameters:
data_type (RPUDataType) –
- Return type:
Any
- bindings_module: ClassVar[str] = 'devices'
- diffusion: float = 0.0
Standard deviation of diffusion process.
- drift: SimpleDriftParameter
Parameter governing a power-law drift.
- lifetime: float = 0.0
One over decay_rate, ie \(1/r_\text{decay}\).
- class aihwkit.simulator.configs.devices.IdealDevice(construction_seed=0, diffusion=0.0, lifetime=0.0, reset_std=0.01)[source]
Bases:
_PrintableMixin
Ideal update behavior (using floating point), but forward/backward might be non-ideal.
Ideal update behavior (using floating point), however, forward/backward might still have a non-ideal ADC or noise added.
- Parameters:
construction_seed (int) –
diffusion (float) –
lifetime (float) –
reset_std (float) –
- as_bindings(data_type)[source]
Return a representation of this instance as a simulator bindings object.
- Parameters:
data_type (RPUDataType) –
- Return type:
Any
- bindings_module: ClassVar[str] = 'devices'
- construction_seed: int = 0
If not
0
, set a unique seed for hidden parameters during construction.
- diffusion: float = 0.0
Standard deviation of diffusion process.
- lifetime: float = 0.0
One over decay_rate, ie \(1/r_\text{decay}\).
- reset_std: float = 0.01
Standard deviation around zero mean in case reset is called.
- class aihwkit.simulator.configs.devices.LinearStepDevice(construction_seed=0, corrupt_devices_prob=0.0, corrupt_devices_range=0.1, diffusion=0.0, diffusion_dtod=0.0, drift=<factory>, dw_min=0.001, dw_min_dtod=0.3, dw_min_dtod_log_normal=False, dw_min_std=0.3, enforce_consistency=True, lifetime=0.0, lifetime_dtod=0.0, perfect_bias=False, reset=0.0, reset_dtod=0.0, reset_std=0.01, up_down=0.0, up_down_dtod=0.01, w_max=0.6, w_max_dtod=0.3, w_min=-0.6, w_min_dtod=0.3, count_pulses=False, gamma_up=0.0, gamma_down=0.0, gamma_up_dtod=0.05, gamma_down_dtod=0.05, allow_increasing=False, mean_bound_reference=True, mult_noise=True, write_noise_std=0.0, apply_write_noise_on_set=True, reverse_up=False, reverse_down=False, reverse_offset=0.01)[source]
Bases:
PulsedDevice
Pulsed update behavioral model: linear step.
Pulsed update behavioral model, where the update step response size of the material is linearly dependent with resistance (up to hard bounds).
This model is based on
PulsedDevice
and thus shares all parameters and functionality. In addition, it only implements a more general update once function, where the update step size can depend linearly on the weight itself.For each coincidence the weights is updated once. Here, the positive (negative) update step size decreases linearly in the following manner (compare to the update once for
ConstantStepDevice
):\begin{eqnarray*} w_{ij} &\leftarrow& w_{ij} - \Delta w_{ij}^d(\gamma_{ij}^d\;w_{ij} + 1 + \sigma_\text{c-to-c}\,\xi)\\ w_{ij} &\leftarrow& \text{clip}(w_{ij},b^\text{min}_{ij},b^\text{max}_{ij}) \end{eqnarray*}in case of additive noise. Optionally, multiplicative noise can be chosen in which case the first equation becomes:
\[w_{ij} \leftarrow w_{ij} - \Delta w_{ij}^d (\gamma_{ij}^d \;w_{ij} + 1) (1 + \sigma_\text{c-to-c}\,\xi)\]The cross-point ij dependent slope parameter \(\gamma_{ij}^d\) are given during initialization by
\begin{eqnarray*} \gamma_{ij}^+ &\=& - |\gamma^+ + \gamma_\text{d-to-d}^+ \xi|/b^\text{max}_{ij}\\ \gamma_{ij}^- &\=& - |\gamma^- + \gamma_\text{d-to-d}^- \xi|/b^\text{min}_{ij} \end{eqnarray*}where the \(\xi\) are standard Gaussian random variables and \(b^\text{min}_{ij}\) and \(b^\text{max}_{ij}\) the cross-point ij specific minimal and maximal weight bounds, respectively (see description for
PulsedDevice
).Note
If \(\gamma=1\) and \(\gamma_\text{d-to-d}=0\) this update implements soft bounds, since the updates step becomes equal to \(1/b\).
Note
If \(\gamma=0\) and \(\gamma_\text{d-to-d}=0\) and additive noise, this update is identical to those described in
PulsedDevice
.- Parameters:
construction_seed (int) –
corrupt_devices_prob (float) –
corrupt_devices_range (float) –
diffusion (float) –
diffusion_dtod (float) –
drift (DriftParameter) –
dw_min (float) –
dw_min_dtod (float) –
dw_min_dtod_log_normal (bool) –
dw_min_std (float) –
enforce_consistency (bool) –
lifetime (float) –
lifetime_dtod (float) –
perfect_bias (bool) –
reset (float) –
reset_dtod (float) –
reset_std (float) –
up_down (float) –
up_down_dtod (float) –
w_max (float) –
w_max_dtod (float) –
w_min (float) –
w_min_dtod (float) –
count_pulses (bool) –
gamma_up (float) –
gamma_down (float) –
gamma_up_dtod (float) –
gamma_down_dtod (float) –
allow_increasing (bool) –
mean_bound_reference (bool) –
mult_noise (bool) –
write_noise_std (float) –
apply_write_noise_on_set (bool) –
reverse_up (bool) –
reverse_down (bool) –
reverse_offset (float) –
- allow_increasing: bool = False
Whether to allow increasing of update sizes.
Whether to allow the situation where update sizes increase towards the bound instead of saturating (and thus becoming smaller).
- apply_write_noise_on_set: bool = True
Whether setting the weights with
set_weights
will add write noise to the apparent weight state or not.If
False
the persistent weight state will be equal to the apparent state initially.
- gamma_down: float = 0.0
The value of \(\gamma^-\).
- gamma_down_dtod: float = 0.05
Device-to-device variation for \(\gamma^-\), i.e. the value of \(\gamma_\text{d-to-d}^-\).
- gamma_up: float = 0.0
The value of \(\gamma^+\).
Intuitively, a value of 0.1 means that the update step size in up direction at the weight bounds is 10% decreased relative to that origin \(w=0\).
Note
In principle one could fix \(\gamma=\gamma^-=\gamma^+\) since up/down variation can be given by
up_down_dtod
, seePulsedDevice
.Note
The hard-bounds are still observed, so that the weight cannot grow beyond its bounds.
- gamma_up_dtod: float = 0.05
Device-to-device variation for \(\gamma^+\), i.e. the value of \(\gamma_\text{d-to-d}^+\).
- mean_bound_reference: bool = True
Whether to use instead of the above:
\[ \begin{align}\begin{aligned}\gamma_{ij}^+ &\=& - |\gamma^+ + \gamma_\text{d-to-d}^+ \xi|/b^\text{max}\\\gamma_{ij}^- &\=& - |\gamma^- + \gamma_\text{d-to-d}^- \xi|/b^\text{min}\end{aligned}\end{align} \]where \(b^\text{max}\) and \(b^\text{max}\) are the values given by
w_max
andw_min
, seePulsedDevice
.
- mult_noise: bool = True
Whether to use multiplicative noise instead of additive cycle-to-cycle noise.
- reverse_down: bool = False
Whether to increase the step size in down direction with decreasing weights (default decreases).
Note
If set,
mult_noise
needs to be also set.
- reverse_offset: float = 0.01
Offset to add to the step size for reverse up or down to avoid zero step size at weight min or max.
- reverse_up: bool = False
Whether to increase the step size in up direction with increasing weights (default decreases).
Note
If set,
mult_noise
needs to be also set.
- write_noise_std: float = 0.0
Whether to use update write noise.
Whether to use update write noise that is added to the updated devices weight, while the update is done on a hidden persistent weight. The update write noise is then sampled anew when the device is touched again.
Thus it is:
\[w_\text{apparent}{ij} = w_{ij} + \sigma_\text{write_noise} \Delta w_\text{min}\xi\]and the update is done on \(w_{ij}\) but the forward sees the \(w_\text{apparent}\).
- class aihwkit.simulator.configs.devices.PiecewiseStepDevice(construction_seed=0, corrupt_devices_prob=0.0, corrupt_devices_range=0.1, diffusion=0.0, diffusion_dtod=0.0, drift=<factory>, dw_min=0.001, dw_min_dtod=0.3, dw_min_dtod_log_normal=False, dw_min_std=0.3, enforce_consistency=True, lifetime=0.0, lifetime_dtod=0.0, perfect_bias=False, reset=0.0, reset_dtod=0.0, reset_std=0.01, up_down=0.0, up_down_dtod=0.01, w_max=0.6, w_max_dtod=0.3, w_min=-0.6, w_min_dtod=0.3, count_pulses=False, piecewise_up=<factory>, piecewise_down=<factory>, write_noise_std=0.0, apply_write_noise_on_set=True)[source]
Bases:
PulsedDevice
Piece-wise interpolated device update characteristics.
This model is derived from
PulsedDevice
and uses all its parameters.PiecewiseStepDevice
implements a new functionality where the device’s update response curve is given explicitly on nodes over the weight range. The device will automatically interpolate the update step size using the given node values.In detail, the update in down direction of the device is given as:
\[w_{ij} \leftarrow w_{ij} + \Delta w_{ij}^d \left((1 - q) v^d(i_w) + q \, v^d(i_w + 1)\right) (1 + \sigma_\text{c-to-c}\,\xi)\]where \(i_w\) is the index of the given vector \(v^d\) (
piecewise_down
) where the current weight value would fall into if scaled to the current min and max values of that device (first and last value are set at weight min and max, respectively, the other values are equally distributed in the range).The scalar \(q\) is the relative position of the weight in the current segment between the two selected nodes \(v^d(i_w)\) and \(v^d(i_w + 1)\).
The update in up direction is computed analogously using the
piecewise_up
vector.Note
The piecewise up and down vectors need to have the same number of elements.
Note
In case of GPUs the maximal number of nodes in the vectors is limited to below 64 due to performance reasons.
- Parameters:
construction_seed (int) –
corrupt_devices_prob (float) –
corrupt_devices_range (float) –
diffusion (float) –
diffusion_dtod (float) –
drift (DriftParameter) –
dw_min (float) –
dw_min_dtod (float) –
dw_min_dtod_log_normal (bool) –
dw_min_std (float) –
enforce_consistency (bool) –
lifetime (float) –
lifetime_dtod (float) –
perfect_bias (bool) –
reset (float) –
reset_dtod (float) –
reset_std (float) –
up_down (float) –
up_down_dtod (float) –
w_max (float) –
w_max_dtod (float) –
w_min (float) –
w_min_dtod (float) –
count_pulses (bool) –
piecewise_up (List[float]) –
piecewise_down (List[float]) –
write_noise_std (float) –
apply_write_noise_on_set (bool) –
- apply_write_noise_on_set: bool = True
Whether setting the weights with
set_weights
will add write noise to the apparent weight state or not.If
False
the persistent weight state will be equal to the apparent state initially.
- piecewise_down: List[float]
Array of values that characterize the update steps in downwards direction.
Analogous to
piecewise_up
but for the downwards direction.
- piecewise_up: List[float]
Array of values that characterize the update steps in upwards direction.
The values are equally spaced in
w_min
and w_max` (which could vary from device-to-device), where the first and the last value is set at the boundary. The update will be computed by linear interpolation of the adjacent values, depending on where the weight is currently within the range.The values are given as relative numbers: the final update size will be computed by multiplying the value with the current
dw_min
of the device.E.g.
[1.5, 1, 1.5]
anddw_min=0.1
means that the update (in up direction) isdw_min
around zero weight value and linearly increasing to1.5 * dw_min
for larger or smaller weight values.
- write_noise_std: float = 0.0
Whether to use update write noise.
Whether to use update write noise that is added to the updated devices weight, while the update is done on a hidden persistent weight. The update write noise is then sampled a new when the device is touched again.
Thus it is:
\[w_\text{apparent}{ij} = w_{ij} + \sigma_\text{write_noise}\xi\]and the update is done on \(w_{ij}\) but the forward sees the \(w_\text{apparent}\).
- class aihwkit.simulator.configs.devices.PowStepDevice(construction_seed=0, corrupt_devices_prob=0.0, corrupt_devices_range=0.1, diffusion=0.0, diffusion_dtod=0.0, drift=<factory>, dw_min=0.001, dw_min_dtod=0.3, dw_min_dtod_log_normal=False, dw_min_std=0.3, enforce_consistency=True, lifetime=0.0, lifetime_dtod=0.0, perfect_bias=False, reset=0.0, reset_dtod=0.0, reset_std=0.01, up_down=0.0, up_down_dtod=0.01, w_max=0.6, w_max_dtod=0.3, w_min=-0.6, w_min_dtod=0.3, count_pulses=False, pow_gamma=1.0, pow_gamma_dtod=0.1, pow_up_down=0.0, pow_up_down_dtod=0.0, write_noise_std=0.0, apply_write_noise_on_set=True)[source]
Bases:
PulsedDevice
Pulsed update behavioral model: power-dependent step.
Pulsed update behavioral model, where the update step response size of the material has a power-dependent with resistance. This device model implements (a shifted from of) the Fusi & Abott (2007) synapse model (see also Frascaroli et al. (2108)).
The model based on
PulsedDevice
and thus shares most parameters and functionality. However, it implements new update once function, where the update step size depends in the following way. If we set \(\omega_{ij} = \frac{b_{ij}^\text{max} - w_{ij}}{b_{ij}^\text{max} - b_{ij}^\text{min}}\) the relative distance of the current weight to the upper bound, then the update per pulse is for the upwards direction:\[w_{ij} \leftarrow w_{ij} + \Delta w_{ij}^+\,(\omega_{ij})^{\gamma_{ij}^+} \left(1 + \sigma_\text{c-to-c}\,\xi\right)\]and in downwards direction:
\[w_{ij} \leftarrow w_{ij} + \Delta w_{ij}^-\,(1 - \omega_{ij})^{\gamma_{ij}^-} \left(1 + \sigma_\text{c-to-c}\,\xi\right)\]Similar to \(\Delta w_{ij}^d\) the exponent \(\gamma_{ij}\) can be defined with device-to-device variation and bias in up and down direction:
\[\gamma_{ij}^d = \gamma\, \left(1 + d\, \beta_{ij} + \sigma_\text{pow-gamma-d-to-d}\xi\right)\]where \(\xi\) is again a standard Gaussian. \(\beta_{ij}\) is the directional up versus down bias. At initialization
pow_up_down_dtod
andpow_up_down
defines this bias term:\[\beta_{ij} = \beta_\text{pow-up-down} + \xi\sigma_\text{pow-up-down-dtod}\]where \(\xi\) is again a standard Gaussian number and \(\beta_\text{pow-up-down}\) corresponds to
pow_up_down
.Note
The
pow_gamma_dtod
andpow_up_down_dtod
device-to-device variation parameters are given in relative units topow_gamma
.Note
\(\Delta w_{ij}^d\) is defined as for the
PulsedDevice
, however, for this device, the update step size will not be given by \(\Delta w_{ij}\) at \(w_{ij}=0\) as for most other devices models- Parameters:
construction_seed (int) –
corrupt_devices_prob (float) –
corrupt_devices_range (float) –
diffusion (float) –
diffusion_dtod (float) –
drift (DriftParameter) –
dw_min (float) –
dw_min_dtod (float) –
dw_min_dtod_log_normal (bool) –
dw_min_std (float) –
enforce_consistency (bool) –
lifetime (float) –
lifetime_dtod (float) –
perfect_bias (bool) –
reset (float) –
reset_dtod (float) –
reset_std (float) –
up_down (float) –
up_down_dtod (float) –
w_max (float) –
w_max_dtod (float) –
w_min (float) –
w_min_dtod (float) –
count_pulses (bool) –
pow_gamma (float) –
pow_gamma_dtod (float) –
pow_up_down (float) –
pow_up_down_dtod (float) –
write_noise_std (float) –
apply_write_noise_on_set (bool) –
- apply_write_noise_on_set: bool = True
Whether setting the weights with
set_weights
will add write noise to the apparent weight state or not.If
False
the persistent weight state will be equal to the apparent state initially.
- pow_gamma: float = 1.0
The value of \(\gamma\) as explained above.
Note
\(\gamma\) reduces essentially to the
SoftBoundsDevice
(if no device-to-device variation of gamma is used additionally). However, theSoftBoundsDevice
will be much faster, as it does not need to compute the slow pow function.
- pow_gamma_dtod: float = 0.1
Device-to-device variation for
pow_gamma
.i.e. the value of \(\gamma_\text{pow-gamma-d-to-d}\) given in relative units to
pow_gamma
.
- pow_up_down: float = 0.0
The up versus down bias of the \(\gamma\) as described above.
It is \(\gamma^+ = \gamma (1 + \beta_\text{pow-up-down})\) and \(\gamma^- = \gamma (1 - \beta_\text{pow-up-down})\) .
- pow_up_down_dtod: float = 0.0
Device-to-device variation in the up versus down bias of \(\gamma\) as descibed above.
In units of
pow_gamma
.
- write_noise_std: float = 0.0
Whether to use update write noise.
Whether to use update write noise that is added to the updated devices weight, while the update is done on a hidden persistent weight. The update write noise is then sampled a new when the device is touched again.
Thus it is:
\[w_\text{apparent}{ij} = w_{ij} + \sigma_\text{write_noise}\xi\]and the update is done on \(w_{ij}\) but the forward sees the \(w_\text{apparent}\).
- class aihwkit.simulator.configs.devices.PowStepReferenceDevice(construction_seed=0, corrupt_devices_prob=0.0, corrupt_devices_range=0.1, diffusion=0.0, diffusion_dtod=0.0, drift=<factory>, dw_min=0.001, dw_min_dtod=0.3, dw_min_dtod_log_normal=False, dw_min_std=0.3, enforce_consistency=True, lifetime=0.0, lifetime_dtod=0.0, perfect_bias=False, reset=0.0, reset_dtod=0.0, reset_std=0.01, up_down=0.0, up_down_dtod=0.01, w_max=0.6, w_max_dtod=0.3, w_min=-0.6, w_min_dtod=0.3, count_pulses=False, pow_gamma=1.0, pow_gamma_dtod=0.1, pow_up_down=0.0, pow_up_down_dtod=0.0, subtract_symmetry_point=False, n_estimation_steps=-1, reference_mean=0.0, reference_std=0.0)[source]
Bases:
PulsedDevice
Pulsed update behavioral model: power-dependent step.
Pulsed update behavioral model, where the update step response size of the material has a power-dependent with resistance. This device model implements (a shifted from of) the Fusi & Abott (2007) synapse model (see also Frascaroli et al. (2108)).
This device model is identical to
PowStepDevice
, however, here it does not implement any write noise functionality but instead has an additional option to subtract a reference conductance from the weights which is statically set during initialization.The model based on
PulsedDevice
and thus shares most parameters and functionality. However, it implements newupdate once
function, where the update step size depends in the following way. If we set \(\omega_{ij} = \frac{b_{ij}^\text{max} - w_{ij}}{b_{ij}^\text{max} - b_{ij}^\text{min}}\) the relative distance of the current weight to the upper bound, then the update per pulse is for the upwards direction:\[w_{ij} \leftarrow w_{ij} + \Delta w_{ij}^+\,(\omega_{ij})^{\gamma_{ij}^+} \left(1 + \sigma_\text{c-to-c}\,\xi\right)\]and in downwards direction:
\[w_{ij} \leftarrow w_{ij} + \Delta w_{ij}^-\,(1 - \omega_{ij})^{\gamma_{ij}^-} \left(1 + \sigma_\text{c-to-c}\,\xi\right)\]Similar to \(\Delta w_{ij}^d\) the exponent \(\gamma_{ij}\) can be defined with device-to-device variation and bias in up and down direction:
\[\gamma_{ij}^d = \gamma\, \left(1 + d\, \beta_{ij} + \sigma_\text{pow-gamma-d-to-d}\xi\right)\]where \(\xi\) is again a standard Gaussian. \(\beta_{ij}\) is the directional up versus down bias. At initialization
pow_up_down_dtod
andpow_up_down
defines this bias term:\[\beta_{ij} = \beta_\text{pow-up-down} + \xi\sigma_\text{pow-up-down-dtod}\]where \(\xi\) is again a standard Gaussian number and \(\beta_\text{pow-up-down}\) corresponds to
pow_up_down
.Note
The
pow_gamma_dtod
andpow_up_down_dtod
device-to-device variation parameters are given in relative units topow_gamma
.Note
\(\Delta w_{ij}^d\) is defined as for the
PulsedDevice
, however, for this device, the update step size will not be given by \(\Delta w_{ij}\) at \(w_{ij}=0\) as for most other devices modelsNote
In contrast to
PowStepDevice
, write noise is not supported.- Parameters:
construction_seed (int) –
corrupt_devices_prob (float) –
corrupt_devices_range (float) –
diffusion (float) –
diffusion_dtod (float) –
drift (DriftParameter) –
dw_min (float) –
dw_min_dtod (float) –
dw_min_dtod_log_normal (bool) –
dw_min_std (float) –
enforce_consistency (bool) –
lifetime (float) –
lifetime_dtod (float) –
perfect_bias (bool) –
reset (float) –
reset_dtod (float) –
reset_std (float) –
up_down (float) –
up_down_dtod (float) –
w_max (float) –
w_max_dtod (float) –
w_min (float) –
w_min_dtod (float) –
count_pulses (bool) –
pow_gamma (float) –
pow_gamma_dtod (float) –
pow_up_down (float) –
pow_up_down_dtod (float) –
subtract_symmetry_point (bool) –
n_estimation_steps (int) –
reference_mean (float) –
reference_std (float) –
- n_estimation_steps: int = -1
The number of times to run an (noise-free) up / down pulse combination for the numerical estimation of the symmetry points.
In case of a non-positive number, the number of estimations steps is set 10 times the expected number of states of each device (maxed out at 10000).
- pow_gamma: float = 1.0
The value of \(\gamma\) as explained above.
Note
\(\gamma\) reduces essentially to the
SoftBoundsDevice
(if no device-to-device variation of gamma is used additionally). However, theSoftBoundsDevice
will be much faster, as it does not need to compute the slow pow function.
- pow_gamma_dtod: float = 0.1
Device-to-device variation for
pow_gamma
.i.e. the value of \(\gamma_\text{pow-gamma-d-to-d}\) given in relative units to
pow_gamma
.
- pow_up_down: float = 0.0
The up versus down bias of the \(\gamma\) as described above.
It is \(\gamma^+ = \gamma (1 + \beta_\text{pow-up-down})\) and \(\gamma^- = \gamma (1 - \beta_\text{pow-up-down})\) .
- pow_up_down_dtod: float = 0.0
Device-to-device variation in the up versus down bias of \(\gamma\) as descibed above.
In units of
pow_gamma
.
- reference_mean: float = 0.0
Added to all devices of the reference \(r\).
- reference_std: float = 0.0
Normal distributed device-to-device variation added to the reference \(r\).
- subtract_symmetry_point: bool = False
Whether store the symmetry point of each device onto the reference device.
The symmetry point is only numerically estimated, since an analytically for is not available due to the power step model.
- class aihwkit.simulator.configs.devices.PulsedDevice(construction_seed=0, corrupt_devices_prob=0.0, corrupt_devices_range=0.1, diffusion=0.0, diffusion_dtod=0.0, drift=<factory>, dw_min=0.001, dw_min_dtod=0.3, dw_min_dtod_log_normal=False, dw_min_std=0.3, enforce_consistency=True, lifetime=0.0, lifetime_dtod=0.0, perfect_bias=False, reset=0.0, reset_dtod=0.0, reset_std=0.01, up_down=0.0, up_down_dtod=0.01, w_max=0.6, w_max_dtod=0.3, w_min=-0.6, w_min_dtod=0.3, count_pulses=False)[source]
Bases:
_PrintableMixin
Pulsed update resistive devices.
Device are used as part of an
AnalogTile
to implement the update once characteristics, i.e. the material response properties when a single update pulse is given (a coincidence between row and column pulse train happened).Common properties of all pulsed devices include:
Reset:
Resets the weight in cross points to (around) zero with cycle-to-cycle and systematic spread around a mean.
Important
Reset with given parameters is only activated when
reset_weights()
is called explicitly by the user.Decay:
\[w_{ij} \leftarrow (w_{ij} - b_{ij})\,(1-\alpha_\text{decay}\delta_{ij}) + b_{ij}\]Weight decay is only activated by inserting a specific call to
decay_weights()
, which is done automatically for a tile each mini-batch is decay is present. Note that the devicedecay_lifetime
parameters (1 over decay rates \(\delta_{ij}\)) are analog tile specific and are thus set and fixed during RPU initialization. \(\alpha_\text{decay}\) is a scaling factor that can be given during run-time.The bias \(b_{ij}\) is given by the reset bias and which is determined by the parameter
reset
(mean value) andreset_dtod
(device-to-device variability). Thus\[b_{ij} = \mu_\text{reset} \left(1 + \sigma_\text{reset-dtod}\xi\right)\]Note that the reset bias is also applied in case the device is reset (see above).
Diffusion:
Similar to the decay, diffusion is only activated by inserting a specific call to
diffuse_weights()
, which is done automatically for a tile each mini-batch is diffusion is present. The parameters of the diffusion process are set during RPU initialization and are fixed for the remainder.\[w_{ij} \leftarrow w_{ij} + \rho_{ij} \, \xi;\]where \(xi\) is a standard Gaussian variable and \(\rho_{ij}\) the diffusion rate for a cross-point ij.
Note
If diffusion happens to move the weight beyond the hard bounds of the weight it is ensured to be clipped appropriately.
Drift:
Optional power-law drift setting, as described in
DriftParameter
.Important
Similar to reset, drift is not applied automatically each mini-batch but requires an explicit call to
drift_weights()
each time the drift should be applied.- Parameters:
construction_seed (int) –
corrupt_devices_prob (float) –
corrupt_devices_range (float) –
diffusion (float) –
diffusion_dtod (float) –
drift (DriftParameter) –
dw_min (float) –
dw_min_dtod (float) –
dw_min_dtod_log_normal (bool) –
dw_min_std (float) –
enforce_consistency (bool) –
lifetime (float) –
lifetime_dtod (float) –
perfect_bias (bool) –
reset (float) –
reset_dtod (float) –
reset_std (float) –
up_down (float) –
up_down_dtod (float) –
w_max (float) –
w_max_dtod (float) –
w_min (float) –
w_min_dtod (float) –
count_pulses (bool) –
- as_bindings(data_type)[source]
Return a representation of this instance as a simulator bindings object.
- Parameters:
data_type (RPUDataType) –
- Return type:
Any
- bindings_module: ClassVar[str] = 'devices'
- construction_seed: int = 0
If not equal 0, will set a unique seed for hidden parameters during construction.
- corrupt_devices_prob: float = 0.0
Probability for devices to be corrupt (weights fixed to random value with hard bounds, that is min and max bounds are set to equal).
- corrupt_devices_range: float = 0.1
Range around zero for establishing corrupt devices.
- count_pulses: bool = False
Whether to count the positive and negative pulses that were applied.
Only for GPU devices currently implemented. Some runtime penalty expected.
Pulses can be obtained by
analog_tile.tile.get_pulse_counters()
- diffusion: float = 0.0
Standard deviation of diffusion process.
- diffusion_dtod: float = 0.0
Device-to device variation of diffusion rate in relative units.
- drift: DriftParameter
Parameter governing a power-law drift.
- dw_min: float = 0.001
Mean of the minimal update step sizes across devices and directions.
- dw_min_dtod: float = 0.3
Device-to-device std deviation of
dw_min
(in relative units todw_min
).
- dw_min_dtod_log_normal: bool = False
Device-to-device std deviation
dw_min_dtod
given using a log-normal instead of normal distribution.
- dw_min_std: float = 0.3
Cycle-to-cycle variation size of the update step (related to \(\sigma_\text{c-to-c}\) above) in relative units to
dw_min
.Note
Many spread (device-to-device variation) parameters are given in relative units. For instance e.g. a setting of
dw_min_std
of 0.1 would mean 10% spread around the mean and thus a resulting standard deviation (\(\sigma_\text{c-to-c}\)) ofdw_min
*dw_min_std
.
- enforce_consistency: bool = True
Whether to enforce weight bounds consistency during initialization.
Whether to enforce that max weight bounds cannot be smaller than min weight bounds, and up direction step size is positive and down negative. Switches the opposite values if encountered during init.
- lifetime: float = 0.0
One over decay_rate, ie \(1/r_\text{decay}\).
- lifetime_dtod: float = 0.0
Device-to-device variation in the decay rate (in relative units).
- perfect_bias: bool = False
No up-down differences and device-to-device variability in the bounds for the devices in the bias row.
- reset: float = 0.0
The reset values and spread per cross-point
ij
when using reset functionality of the device.
- reset_dtod: float = 0.0
See
reset
.
- reset_std: float = 0.01
See
reset
.
- up_down: float = 0.0
Up and down direction step sizes can be systematically different and also vary across devices.
\(\Delta w_{ij}^d\) is set during RPU initialization (for each cross-point \(ij\)):
\[\Delta w_{ij}^d = d\; \Delta w_\text{min}\, \left( 1 + d \beta_{ij} + \sigma_\text{d-to-d}\xi\right)\]where \(\xi\) is again a standard Gaussian. \(\beta_{ij}\) is the directional up versus down bias. At initialization
up_down_dtod
andup_down
defines this bias term:\[\beta_{ij} = \beta_\text{up-down} + \xi \sigma_\text{up-down-dtod}\]where \(\xi\) is again a standard Gaussian number and \(\beta_\text{up-down}\) corresponds to
up_down
. Note thatup_down_dtod
is again given in relative units todw_min
.
- up_down_dtod: float = 0.01
See
up_down
.
- w_max: float = 0.6
See
w_min
.
- w_max_dtod: float = 0.3
See
w_min_dtod
.
- w_min: float = -0.6
Mean of hard bounds across device cross-point ij.
The parameters
w_min
andw_max
are used to set the min/max bounds independently.Note
For this abstract device, we assume that weights can have positive and negative values and are symmetrically around zero. In physical circuit terms, this might be implemented as a difference of two resistive elements.
- w_min_dtod: float = 0.3
Device-to-device variation of the hard bounds.
Device-to-device variation of the hard bounds, of min and max value, respectively. All are given in relative units to
w_min
, orw_max
, respectively.
- class aihwkit.simulator.configs.devices.SoftBoundsDevice(construction_seed=0, corrupt_devices_prob=0.0, corrupt_devices_range=0.1, diffusion=0.0, diffusion_dtod=0.0, drift=<factory>, dw_min=0.001, dw_min_dtod=0.3, dw_min_dtod_log_normal=False, dw_min_std=0.3, enforce_consistency=True, lifetime=0.0, lifetime_dtod=0.0, perfect_bias=False, reset=0.0, reset_dtod=0.0, reset_std=0.01, up_down=0.0, up_down_dtod=0.01, w_max=0.6, w_max_dtod=0.3, w_min=-0.6, w_min_dtod=0.3, count_pulses=False, mult_noise=True, write_noise_std=0.0, apply_write_noise_on_set=True, reverse_up=False, reverse_down=False, reverse_offset=0.01)[source]
Bases:
PulsedDevice
Pulsed update behavioral model: soft bounds.
Pulsed update behavioral model, where the update step response size of the material is linearly dependent and it goes to zero at the bound.
This model is based on
LinearStepDevice
with parameters set to model soft bounds.- Parameters:
construction_seed (int) –
corrupt_devices_prob (float) –
corrupt_devices_range (float) –
diffusion (float) –
diffusion_dtod (float) –
drift (DriftParameter) –
dw_min (float) –
dw_min_dtod (float) –
dw_min_dtod_log_normal (bool) –
dw_min_std (float) –
enforce_consistency (bool) –
lifetime (float) –
lifetime_dtod (float) –
perfect_bias (bool) –
reset (float) –
reset_dtod (float) –
reset_std (float) –
up_down (float) –
up_down_dtod (float) –
w_max (float) –
w_max_dtod (float) –
w_min (float) –
w_min_dtod (float) –
count_pulses (bool) –
mult_noise (bool) –
write_noise_std (float) –
apply_write_noise_on_set (bool) –
reverse_up (bool) –
reverse_down (bool) –
reverse_offset (float) –
- apply_write_noise_on_set: bool = True
Whether setting the weights with
set_weights
will add write noise to the apparent weight state or not.If
False
the persistent weight state will be equal to the apparent state initially.
- mult_noise: bool = True
Whether to use multiplicative noise instead of additive cycle-to-cycle noise.
- reverse_down: bool = False
Whether to increase the step size in down direction with decreasing weights (default decreases).
Note
If set,
mult_noise
needs to be also set.
- reverse_offset: float = 0.01
Offset to add to the step size for reverse up or down to avoid zero step size at weight min or max.
- reverse_up: bool = False
Whether to increase the step size in up direction with increasing weights (default decreases).
Note
If set,
mult_noise
needs to be also set.
- write_noise_std: float = 0.0
Whether to use update write noise.
Whether to use update write noise that is added to the updated devices weight, while the update is done on a hidden persistent weight. The update write noise is then sampled anew when the device is touched again.
Thus it is:
\[w_\text{apparent}{ij} = w_{ij} + \sigma_\text{write_noise} \Delta w_\text{min}\xi\]and the update is done on \(w_{ij}\) but the forward sees the \(w_\text{apparent}\).
- class aihwkit.simulator.configs.devices.SoftBoundsPmaxDevice(construction_seed=0, corrupt_devices_prob=0.0, corrupt_devices_range=0.1, diffusion=0.0, diffusion_dtod=0.0, drift=<factory>, dw_min=<factory>, dw_min_dtod=0.3, dw_min_dtod_log_normal=False, dw_min_std=0.3, enforce_consistency=True, lifetime=0.0, lifetime_dtod=0.0, perfect_bias=False, reset=0.0, reset_dtod=0.0, reset_std=0.01, up_down=<factory>, up_down_dtod=0.01, w_max=<factory>, w_max_dtod=0.3, w_min=<factory>, w_min_dtod=0.3, count_pulses=False, mult_noise=True, write_noise_std=0.0, apply_write_noise_on_set=True, reverse_up=False, reverse_down=False, reverse_offset=0.01, p_max=1000, alpha=0.0005, range_min=-1.0, range_max=1.0)[source]
Bases:
SoftBoundsDevice
Pulsed update behavioral model: soft bounds, with a different parameterization for easier device fitting to experimental data.
Under the hood, the same device behavior as
SoftboundsDevice
This model is based onLinearStepDevice
with parameters set to model soft bounds.It implements pulse response function of the form:
\[ \begin{align}\begin{aligned}w(p_\text{up}) = B\left(1 -e^{-\alpha p_\text{up}} \right) + r_\text{min}\\w(p_\text{down}) = - B\left(1 - e^{-\alpha (p_\text{max} - p_\text{down})}\right) + r_\text{max}\end{aligned}\end{align} \]where \(B=\frac{r_\text{max} - r_\text{min}}{1 - e^{-\alpha p_\text{max}}}\).
Here \(p_\text{max}\) is the number of pulses that were applied to get the device from the minimum conductance (minimum of range, \(r_\text{min}\)) to the maximum (maximum of range, \(r_\text{max}\)).
Internally the following transformation is used to get the original parameter of
SoftboundsDevice
:b_factor = (range_max - range_min)/(1 - exp(-p_max * alpha)) w_min = range_min w_max = range_min + b_factor dw_min = b_factor * alpha up_down = 1 + 2 * range_min / b_factor
Note
Device-to-device and cycle-to-cycle variation are defined as before (see
SoftBoundsDevice
, see alsoPulsedDevice
). That is, for instance dw_min_dtod will effectively change the slope (in units ofdw_min
which isb_factor * alpha
, see above). Range offset fluctuations can be achieved by usingw_min_dtod
andw_max_dtod
which will varyw_min
andw_max
across devices, respectively.- Parameters:
construction_seed (int) –
corrupt_devices_prob (float) –
corrupt_devices_range (float) –
diffusion (float) –
diffusion_dtod (float) –
drift (DriftParameter) –
dw_min (float) –
dw_min_dtod (float) –
dw_min_dtod_log_normal (bool) –
dw_min_std (float) –
enforce_consistency (bool) –
lifetime (float) –
lifetime_dtod (float) –
perfect_bias (bool) –
reset (float) –
reset_dtod (float) –
reset_std (float) –
up_down (float) –
up_down_dtod (float) –
w_max (float) –
w_max_dtod (float) –
w_min (float) –
w_min_dtod (float) –
count_pulses (bool) –
mult_noise (bool) –
write_noise_std (float) –
apply_write_noise_on_set (bool) –
reverse_up (bool) –
reverse_down (bool) –
reverse_offset (float) –
p_max (int) –
alpha (float) –
range_min (float) –
range_max (float) –
- alpha: float = 0.0005
The slope of the soft bounds model \(dw \propto \alpha w\) for both up and down direction.
- as_bindings(data_type)[source]
Return a representation of this instance as a simulator bindings object.
- Parameters:
data_type (RPUDataType) –
- Return type:
Any
- p_max: int = 1000
Number of pulses to drive the synapse from
range_min
torange_max
.
- range_max: float = 1.0
Value of the weight for \(P_max\) number of up pulses.
- range_min: float = -1.0
Setting of the weight when starting the \(P_max\) up pulse experiment.
- class aihwkit.simulator.configs.devices.SoftBoundsReferenceDevice(construction_seed=0, corrupt_devices_prob=0.0, corrupt_devices_range=0.1, diffusion=0.0, diffusion_dtod=0.0, drift=<factory>, dw_min=0.001, dw_min_dtod=0.3, dw_min_dtod_log_normal=False, dw_min_std=0.3, enforce_consistency=True, lifetime=0.0, lifetime_dtod=0.0, perfect_bias=False, reset=0.0, reset_dtod=0.0, reset_std=0.01, up_down=0.0, up_down_dtod=0.01, w_max=0.6, w_max_dtod=0.3, w_min=-0.6, w_min_dtod=0.3, count_pulses=False, mult_noise=False, write_noise_std=0.0, apply_write_noise_on_set=True, slope_up_dtod=0.0, slope_down_dtod=0.0, reference_mean=0.0, reference_std=0.0, subtract_symmetry_point=False)[source]
Bases:
PulsedDevice
Pulsed update behavioral model: soft bounds with reference device.
Pulsed update behavioral model, where the update step response size of the material is linearly dependent.
In particular, the update behavior is
\[ \begin{align}\begin{aligned}\delta W_+ = \alpha_{+}(1 - \frac{w}{\beta_{max}}) (1 + \sigma \xi)\\\delta W_- = \alpha_{-}(1 - \frac{w}{\beta_{min}}) (1 + \sigma \xi)\end{aligned}\end{align} \]Where the same device-to-device variation can be given as for the
PulsedDevice
. In addition, a device-to-device variation can be directly given on the slope. The \(\alpha_{+}\) and \(\alpha_{-}\) are the scaling factors that determine the magnitude of positive and negative weight updates.Moreover, a fixed reference conductance can be subtracted from the resulting weight, which implemented a differential read of \(w - r\).
- Parameters:
construction_seed (int) –
corrupt_devices_prob (float) –
corrupt_devices_range (float) –
diffusion (float) –
diffusion_dtod (float) –
drift (DriftParameter) –
dw_min (float) –
dw_min_dtod (float) –
dw_min_dtod_log_normal (bool) –
dw_min_std (float) –
enforce_consistency (bool) –
lifetime (float) –
lifetime_dtod (float) –
perfect_bias (bool) –
reset (float) –
reset_dtod (float) –
reset_std (float) –
up_down (float) –
up_down_dtod (float) –
w_max (float) –
w_max_dtod (float) –
w_min (float) –
w_min_dtod (float) –
count_pulses (bool) –
mult_noise (bool) –
write_noise_std (float) –
apply_write_noise_on_set (bool) –
slope_up_dtod (float) –
slope_down_dtod (float) –
reference_mean (float) –
reference_std (float) –
subtract_symmetry_point (bool) –
- apply_write_noise_on_set: bool = True
Whether setting the weights with
set_weights
will add write noise to the apparent weight state or not.If
False
the persistent weight state will be equal to the apparent state initially.
- mult_noise: bool = False
Whether to use multiplicative noise instead of additive cycle-to-cycle noise.
- reference_mean: float = 0.0
Added to all devices of the reference \(r\).
- reference_std: float = 0.0
Normal distributed device-to-device variation added to the reference \(r\).
- slope_down_dtod: float = 0.0
Device-to-device variation on the down-pulse slope.
Note
Since the up slope is proportional to \(\propto\frac{1}{b_\text{min}}\) the device-to-device variation of the weight max
w_min_dtod
will also introduce a slope variation. Turn that off, if the variation should be only on the slope directly.
- slope_up_dtod: float = 0.0
Device-to-device variation on the up-pulse slope.
Note
Since the up slope is proportional to \(\propto\frac{1}{b_\text{max}}\) the device-to-device variation of the weight max
w_max_dtod
will also introduce a slope variation. Turn that off, if the variation should be only on the slope directly.
- subtract_symmetry_point: bool = False
Whether to add the computed symmetry point of the devices onto the reference \(r\).
The symmetry point is given by:
\[w_* = \frac{\alpha_{+} - \alpha_{-}}{\frac{\alpha_{+}}{b_\text{max}} - \frac{\alpha_{-}}{b_\text{min}}}\]
- write_noise_std: float = 0.0
Whether to use update write noise.
Whether to use update write noise that is added to the updated devices weight, while the update is done on a hidden persistent weight. The update write noise is then sampled anew when the device is touched again.
Thus it is:
\[w_\text{apparent}{ij} = w_{ij} + \sigma_\text{write_noise} \Delta w_\text{min}\xi\]and the update is done on \(w_{ij}\) but the forward sees the \(w_\text{apparent}\).