Okay… so I proceeded with the following code and executed it on INRC.
def input_spikes(t):
return [get_spikes_1(t), get_spikes_2(t), get_spikes_3(t), get_spikes_4(t)]
with nengo.Network() as net:
ens = nengo.Ensemble(
n_neurons=4,
dimensions=1,
gain=np.array([1, 1, 1, 1]),
bias=np.array([0.5, 0.5, 0.5, 0.5]),
) # 4 single compartment neurons with dimension = 1.
inp = nengo.Node(input_spikes)
nengo.Connection(inp, ens.neurons, synapse=0.005)
n1_probe = nengo.Probe(ens.neurons[0], attr="input")
n2_probe = nengo.Probe(ens.neurons[1], attr="input")
n3_probe = nengo.Probe(ens.neurons[2], attr="input")
n4_probe = nengo.Probe(ens.neurons[3], attr="input")
It execute well and I could plot the input currents to the individual neurons. Upon executing the following code (as you mentioned here):
hw_interface = sim.sims["loihi"]
nxsdk_board = hw_interface.nxsdk_board
board = hw_interface.board
print(board.n_chips, board.n_cores_per_chip, board.n_synapses_per_core)
following is the output:
1 [2] [[8, 0]]
I believe the above implies that the board I have access to is having one Loihi chip, and there are 2 neurocores? per chip, and there are 8 and 0 synapses in each neurocore. Please correct me if I am wrong here.
Next, the output of following:
blocks = sim.model.objs[ens]
print(blocks)
is:
{'in': [<nengo_loihi.block.LoihiBlock object at 0x7f963d7f7640>], 'out': [<nengo_loihi.block.LoihiBlock object at 0x7f963d7f7640>]}
which is a dictionary and not a list. So I guess, assert len(blocks) == 1; block = blocks[0]
won’t work here. Therefore I did the following:
in_chip_idx, in_core_idx, in_block_idx, in_compartment_idxs, _ = board.find_block(blocks["in"])
out_chip_idx, out_core_idx, out_block_idx, out_compartment_idxs, _ = board.find_block(blocks["out"])
print(in_chip_idx, in_core_idx, in_block_idx, in_compartment_idxs)
print(out_chip_idx, out_core_idx, out_block_idx, out_compartment_idxs)
and the output was:
None None None None
None None None None
which again means that this nxsdk_core = nxsdk_board.n2Chips[in_chip_idx].n2CoresAsList[in_core_idx]
won’t work. I believe, in place of None
s there should have been some object IDs or so… Right? Am I executing any step wrongly or missing any (all these codes are run on INRC jupyter notebook)?
Since the join ops can’t be implemented by NengoLoihi
and you suggested to simply allocate some space (in form of an Ensemble
of neurons) on Loihi and then proceed with manually configuring them, I am attempting to do the same. With respect to my NxSDK code using the join ops (as you might have seen), how do I proceed next to configure the same? Please let me know.