Closed matifali closed 4 months ago
https://github.com/IBM/aihwkit/blob/master/src/aihwkit/inference/noise/pcm.py#L153-L160
# expected accumulated 1/f noise since start of programming at t=0 if t > 0: q_s = (0.0088 / ((torch_abs(g_prog) / self.g_max) ** 0.65).clamp(min=1e-3)).clamp( max=0.2 ) sig_noise = q_s * sqrt(numpy_log((t + self.t_read) / (2 * self.t_read))) g_final = g_drift + torch_abs(g_drift) * self.read_noise_scale * sig_noise * randn_like( g_prog )
When t > 0 and t < t_read, this expression becomes undefined as the argument of the log is less than 1, which makes the argument of sqrt negative.
t > 0
t < t_read,
log
sqrt
use t = 50e-9
t = 50e-9
There should be an additional condition on t to make sure its greater than t_read
t
t_read
Closing as I just noted, t = t_infernce + t_0 which makes it at least 20s
t = t_infernce + t_0
Description
https://github.com/IBM/aihwkit/blob/master/src/aihwkit/inference/noise/pcm.py#L153-L160
When
t > 0
andt < t_read,
this expression becomes undefined as the argument of thelog
is less than 1, which makes the argument ofsqrt
negative.How to reproduce
use
t = 50e-9
Expected behavior
There should be an additional condition on
t
to make sure its greater thant_read
Other information