You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm kind of confused how I can convert XyloMonitor output to predicted class, for our case, its 0 to 7 for digits 0 to 7 as we can only use 8 output node. Could you kindly help me with this?
#15
Find and connect to a Xylo A2 HDK
xylo_hdk_nodes, modules, versions = find_xylo_hdks()
print(xylo_hdk_nodes)
if len(xylo_hdk_nodes) == 0 or versions[0] != 'syns61201':
assert False, 'This tutorial requires a connected Xylo A2 HDK to demonstrate.'
else:
db = xylo_hdk_nodes[0]
Use XyloMonitor to deploy to the HDK
You need to wait 45s until the AFE auto-calibration is done
However, I have 2 issues with this. First issue is when I print the output, I got following result. Now I'm kind of confused how I can convert this output to predicted class, for our case, 0 to 7 for digits 0 to 7 as we can only use 8 output node. Could you kindly help me with this?
Side note: When I was running this code, I was playing spoken sounds of digits near the board. However, I'm not sure whether XyloMonitor takes these values from those sound or not, because when I didn't play those sounds, it still get non-zero values instead of 0 values.
My second issue is I got the following value error, However, it seems straight forward to me. It because you didn't update the chip version in your module.
ValueError Traceback (most recent call last)
Cell In[96], line 11
8 T = 250
10 while True:
---> 11 modMonitor = x.XyloMonitor(db, config, dt=net_dt, output_mode=output_mode, amplify_level=amplify_level, hibernation_mode=hibernation, divisive_norm=DN)
12 output, _, _ = modMonitor(input_data=np.zeros((T, Nin)), record = False)
13 print(output)
File ~/.local/lib/python3.8/site-packages/rockpool/nn/modules/module.py:688, in PostInitMetaMixin.call(cls, *args, **kwargs)
686 def call(cls, *args, **kwargs):
687 # - Instantiate the object
--> 688 obj = super().call(*args, **kwargs)
690 # - Check for a __post_init__ method
691 if hasattr(cls, "post_init"):
File ~/.local/lib/python3.8/site-packages/rockpool/devices/xylo/syns61201/xylo_monitor.py:174, in XyloMonitor.init(self, device, config, afe_config, dt, output_mode, amplify_level, change_count, main_clk_rate, hibernation_mode, divisive_norm, divisive_norm_params, calibration_params, read_register, *args, **kwargs)
170 self._chip_version, self._chip_revision = hdkutils.read_afe2_module_version(
171 self._afe_read_buffer, self._afe_write_buffer
172 )
173 if self._chip_version != 1 or self._chip_revision != 0:
--> 174 raise ValueError(
175 f"AFE version is {(self._chip_version, self._chip_revision)}; expected (1, 0)."
176 )
178 # - Change event count number of AFE
179 if change_count is not None:
ValueError: AFE version is (2, 0); expected (1, 0).
This discussion was converted from issue #12 on August 31, 2023 10:56.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was going through this tutorial: https://github.com/synsense/OpenNeuromorphic_26042023/blob/main/live-coding-script-shd.ipynb and trying to implement Xylo Monitor for digit classification using onboard microphone, using the following code:
Find and connect to a Xylo A2 HDK
xylo_hdk_nodes, modules, versions = find_xylo_hdks()
print(xylo_hdk_nodes)
if len(xylo_hdk_nodes) == 0 or versions[0] != 'syns61201':
assert False, 'This tutorial requires a connected Xylo A2 HDK to demonstrate.'
else:
db = xylo_hdk_nodes[0]
Use XyloMonitor to deploy to the HDK
You need to wait 45s until the AFE auto-calibration is done
output_mode = "Vmem"
amplify_level = "low"
hibernation = False
DN = False
T = 250
while True:
modMonitor = x.XyloMonitor(db, config, dt=net_dt, output_mode=output_mode, amplify_level=amplify_level, hibernation_mode=hibernation, divisive_norm=DN)
output, _, _ = modMonitor(input_data=np.zeros((T, Nin)), record = False)
print(output)
However, I have 2 issues with this. First issue is when I print the output, I got following result. Now I'm kind of confused how I can convert this output to predicted class, for our case, 0 to 7 for digits 0 to 7 as we can only use 8 output node. Could you kindly help me with this?
Side note: When I was running this code, I was playing spoken sounds of digits near the board. However, I'm not sure whether XyloMonitor takes these values from those sound or not, because when I didn't play those sounds, it still get non-zero values instead of 0 values.
Configuring AFE...
Configured AFE
[
[57, -59],
[47, -106],
[38, -110],
[30, -97],
[62, -123],
[66, -179],
[5, -211],
[-18, -196],
[-24, -166],
[-23, -133],
[-35, -157],
[-35, -146],
[46, -126],
[72, -80],
[63, -62],
[37, -100],
[23, -102],
[31, -97],
[69, -126],
[59, -174],
[-6, -203],
[-29, -188],
[-11, -138],
[-22, -163],
[-23, -152],
[33, -180],
[50, -168],
[51, -142],
[46, -114],
[23, -142],
[27, -142],
[23, -102],
[81, -75],
[77, -109],
[66, -107],
[54, -93],
[58, -83],
[53, -69],
[45, -54],
[39, -103],
[-9, -140],
[-28, -131],
[-32, -111],
[-45, -143],
[-43, -137],
[-37, -117],
[47, -97],
[73, -77],
[58, -113],
[23, -161],
[8, -158],
[16, -145],
[17, -121],
[61, -144],
[70, -135],
[65, -114],
[55, -91],
[60, -79],
[39, -118],
[5, -166],
[-8, -163],
[42, -193],
[56, -179],
[39, -205],
[29, -188],
[37, -166],
[36, -136],
[31, -108],
[72, -132],
[78, -124],
[71, -105],
[60, -84],
[63, -74],
[42, -114],
[7, -163],
[11, -169],
[27, -157],
[15, -186],
[-23, -158],
[-34, -127],
[-33, -99],
[-23, -58],
[43, -99],
[41, -151],
[35, -151],
[29, -132],
[22, -170],
[-37, -196],
[-54, -181],
[8, -146],
[30, -114],
[35, -87],
[33, -66],
[5, -160],
[-6, -175],
[-9, -158],
[-8, -131],
[54, -99],
[71, -136],
[69, -133],
[37, -163],
[21, -154],
[13, -131],
[-40, -154],
[32, -199],
[55, -191],
[58, -164],
[52, -133],
[28, -157],
[31, -154],
[-25, -167],
[-42, -151],
[18, -120],
[23, -147],
[23, -138],
[-8, -138],
[-19, -120],
[-20, -98],
[-18, -77],
[31, -107],
[61, -113],
[65, -100],
[59, -83],
[35, -119],
[0, -166],
[-13, -162],
[38, -191],
[37, -231],
[0, -201],
[-14, -164],
[-17, -130],
[0, -108],
[-9, -140],
[-10, -134],
[52, -109],
[69, -85],
[67, -65],
[15, -124],
[-60, -164],
[-20, -153],
[-2, -129],
[6, -103],
[8, -138],
[7, -119],
[68, -91],
[82, -69],
[78, -51],
[32, -138],
[15, -158],
[8, -145],
[65, -116],
[112, -96],
[82, -133],
[19, -172],
[43, -153],
[47, -126],
[43, -100],
[64, -129],
[75, -177],
[39, -157],
[21, -129],
[12, -102],
[-42, -127],
[-8, -133],
[67, -112],
[88, -90],
[85, -70],
[74, -53],
[38, -150],
[20, -167],
[-21, -137],
[-33, -108],
[28, -78],
[47, -56],
[34, -94],
[40, -104],
[37, -95],
[32, -79],
[26, -63],
[67, -97],
[90, -105],
[65, -143],
[48, -139],
[36, -120],
[-11, -200],
[-27, -205],
[26, -147],
[43, -107],
[29, -132],
[-34, -158],
[-53, -147],
[-38, -132],
[-28, -110],
[-21, -87],
[31, -115],
[47, -111],
[48, -95],
[35, -134],
[27, -131],
[6, -167],
[-2, -159],
[72, -138],
[68, -161],
[58, -149],
[48, -125],
[23, -153],
[12, -144],
[6, -123],
[80, -102],
[60, -183],
[45, -190],
[2, -153],
[-15, -119],
[-4, -99],
[-15, -132],
[22, -171],
[34, -164],
[35, -141],
[32, -114],
[4, -200],
[-7, -207],
[12, -127],
[64, -100],
[76, -77],
[71, -58],
[27, -100],
[8, -103],
[0, -91],
[14, -144],
[-36, -179],
[-50, -169],
[-48, -143],
[-41, -115],
[28, -146],
[50, -139],
[53, -119],
[48, -96],
[40, -75],
[17, -111],
[7, -110],
[18, -103],
[81, -82],
[95, -63],
[51, -150],
[44, -171],
[-19, -191],
[-40, -174],
[-43, -145],
[7, -163],
[26, -149]
]
My second issue is I got the following value error, However, it seems straight forward to me. It because you didn't update the chip version in your module.
ValueError Traceback (most recent call last)
Cell In[96], line 11
8 T = 250
10 while True:
---> 11 modMonitor = x.XyloMonitor(db, config, dt=net_dt, output_mode=output_mode, amplify_level=amplify_level, hibernation_mode=hibernation, divisive_norm=DN)
12 output, _, _ = modMonitor(input_data=np.zeros((T, Nin)), record = False)
13 print(output)
File ~/.local/lib/python3.8/site-packages/rockpool/nn/modules/module.py:688, in PostInitMetaMixin.call(cls, *args, **kwargs)
686 def call(cls, *args, **kwargs):
687 # - Instantiate the object
--> 688 obj = super().call(*args, **kwargs)
690 # - Check for a
__post_init__
method691 if hasattr(cls, "post_init"):
File ~/.local/lib/python3.8/site-packages/rockpool/devices/xylo/syns61201/xylo_monitor.py:174, in XyloMonitor.init(self, device, config, afe_config, dt, output_mode, amplify_level, change_count, main_clk_rate, hibernation_mode, divisive_norm, divisive_norm_params, calibration_params, read_register, *args, **kwargs)
170 self._chip_version, self._chip_revision = hdkutils.read_afe2_module_version(
171 self._afe_read_buffer, self._afe_write_buffer
172 )
173 if self._chip_version != 1 or self._chip_revision != 0:
--> 174 raise ValueError(
175 f"AFE version is {(self._chip_version, self._chip_revision)}; expected (1, 0)."
176 )
178 # - Change event count number of AFE
179 if change_count is not None:
ValueError: AFE version is (2, 0); expected (1, 0).
Beta Was this translation helpful? Give feedback.
All reactions