lava-nc / lava-dl

Deep Learning library for Lava
https://lava-nc.org
BSD 3-Clause "New" or "Revised" License
149 stars 71 forks source link

next input block does not connect input port to neuron input. #298

Open rileywhite-noblis opened 5 months ago

rileywhite-noblis commented 5 months ago

In the latest release, the in port of the Input AbstractBlock for netx does not connect it's in port to it's neuron in port.

Load any model via netx with an input layer and connect it to data.

net = netx.hdf5.Network(trained_folder + '/network.net')
data.out.connect(net.inp)
sink.connect(net.out)

Then try to run this network, you will get an infinite hang.

Expected behavior I would expect that connecting to the in port of an input block would also establish a connection to the neuron, and let me run the model without hanging.

Environment (please complete the following information):

Additional context It almost seems intentionally left this way, based on examples of running netx models where the data is connected directly to the input's neuron's input port (ignoring the block input port). If this is the case, then I think this input port should be removed to avoid confusion (and maybe an explanation as to why this is necessary). The fix is a one line change, just adding self.inp.connect(self.neuron.a_in) to the init function of the Input block process class.

PhilippPlank commented 4 months ago

Thanks for reporting this issue. @bamsumit Can you take a look when you find some time?

bamsumit commented 3 months ago

@rileywhite-noblis The input block typically consists of neuron only. The fix you suggested works in python but will not work on Loihi because a neuron can only get its input from hardware. That's why its intentionally left dangling.

I am onboard with the idea of deleting it altogether. @rileywhite-noblis would you like to contribute that change?