The issue is in spikingjelly.datasets.shd
specifically in : integrate_events_by_fixed_duration_shd(events: Dict, duration: int, W: int)
x = events['x']
t = events['t']
N = t.size
frames = []
left = 0
right = 0
while True:
t_l = t[left]
while True:
if right == N or t[right] - t_l > duration:
break
else:
right += 1
The values of events['t'] are in seconds (s)
array([0. , 0.001833, 0.002167, ..., 0.698 , 0.6997 , 0.7007 ], dtype=float16)
Since the duration parameter is specified to be an int, we can't use this function correctly.
Using a duration that is in milliseconds (ms) yields wrong data like this:
A simple solution is to convert events['t'] to milliseconds (ms):
t = 1000 * events['t']
which results in correct integration by duration:
I've opened a pull request for this change, if it looks ok.
The issue is in spikingjelly.datasets.shd specifically in : integrate_events_by_fixed_duration_shd(events: Dict, duration: int, W: int)
The values of events['t'] are in seconds (s)
array([0. , 0.001833, 0.002167, ..., 0.698 , 0.6997 , 0.7007 ], dtype=float16)
Since the duration parameter is specified to be an int, we can't use this function correctly. Using a duration that is in milliseconds (ms) yields wrong data like this:
A simple solution is to convert events['t'] to milliseconds (ms):
t = 1000 * events['t']
which results in correct integration by duration:
I've opened a pull request for this change, if it looks ok.