Poisson Generator


#1

Hey Guys,

i need a spike source, so i figured poisson would be a good start.
I tried it with

muscle_neurons = sim.Population(size=1, cellclass=sim.SpikeSourcePoisson())

in my brain file and

@nrp.MapSpikeSource(“arm_neurons”, nrp.brain.muscle_neurons, nrp.poisson)

in my TF. This combination however, throws an error:

Error starting the simulation. (service [/ros_cle_simulation/create_new_simulation] responded with an error: error processing request: wavetest: ‘’ (TF Loading Exception)) (host: localhost)

If i change the cellclass in the brain file, it at least compiles and runs, although it does not work at all as there are no spikes generated.
So all in all, what is the recommended (or better: correct) way of doing this?

Regards,
Ben


#2

At first, I recomment you tag the question as Neurorobotics, so that the relevant people see the question :wink:

Apart from that, this is a good example of a bad error message. Are you running the NRP locally? If so, could you have a look in the console log to find a stack trace?

Otherwise, what the NRP does is to simply output the original error message, which in case of e.g. a KeyError is just the key that was used. So somewhere, you were accessing a “wavetest” of something (perhaps a dictionary) that does has no such entry. For a better help, I would need a stack trace.


#3

Hey,
my bad, i forgot to tag it…
Yes, i am running the NRP locally and “wavetest” is actually just the name of the python function in my TF.
Just a heads up, there is a lot off log dump following, sry in advance

The first thing in my console log to go wrong is the following:

Traceback (most recent call last):
File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/tf_framework/init.py”, line 355, in set_transfer_function
config.active_node.initialize_tf(tf)
File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/tf_framework/_TransferFunctionManager.py”, line 208, in initialize_tf
tf.params[i] = tf.params[i].create_adapter(self)
File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/tf_framework/_Neuron2Robot.py”, line 136, in create_adapter
**self.config)
File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/brainsim/common/__AbstractCommunicationAdapter.py”, line 107, in register_spike_source
device = self.__register_device(populations, spike_generator_type, **params)
File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/brainsim/common/__AbstractCommunicationAdapter.py”, line 92, in __register_device
device.connect(populations)
File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/brainsim/pynn/devices/__PyNNPoissonSpikeGenerator.py”, line 193, in connect
“label”))
File “/home/ben/.opt/platform_venv/lib/python2.7/site-packages/pyNN/nest/projections.py”, line 47, in init
space, label)
File “/home/ben/.opt/platform_venv/lib/python2.7/site-packages/pyNN/common/projections.py”, line 95, in init
assert len(valid_types) > 0
AssertionError

following through the log, the next thing that turns up is this warning:

[/clock ] [rospy.intern] [WARNING] Unknown error initiating TCP/IP socket to 127.0.0.1:40670 (http://127.0.0.1:43957/): Traceback (most recent call last):
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py”, line 556, in connect
self.write_header()
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py”, line 635, in write_header
self.stat_bytes += write_ros_handshake_header(sock, protocol.get_header_fields())
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rosgraph/network.py”, line 422, in write_ros_handshake_header
sock.sendall(s)
File “/usr/lib/python2.7/socket.py”, line 228, in meth
return getattr(self._sock,name)(*args)
error: [Errno 104] Connection reset by peer

which ends in a massive error dump shortly after:

[hbp_nrp_cles] [ERROR] Initialization failed
Traceback (most recent call last):
File “/home/ben/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/ROSCLESimulationFactory.py”, line 222, in create_new_simulation
launcher.initialize(environment_file, self.except_hook)
File “/home/ben/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/SimulationAssembly.py”, line 120, in initialize
self._initialize(environment, except_hook)
File “/home/ben/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/CLEGazeboSimulationAssembly.py”, line 427, in _initialize
self.__load_tfs()
File “/home/ben/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/CLEGazeboSimulationAssembly.py”, line 663, in __load_tfs
nrp.set_transfer_function(tf_code, new_code, tf.name)
File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/tf_framework/init.py”, line 355, in set_transfer_function
config.active_node.initialize_tf(tf)
File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/tf_framework/_TransferFunctionManager.py”, line 208, in initialize_tf
tf.params[i] = tf.params[i].create_adapter(self)
File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/tf_framework/_Neuron2Robot.py”, line 136, in create_adapter
**self.config)
File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/brainsim/common/__AbstractCommunicationAdapter.py”, line 107, in register_spike_source
device = self.__register_device(populations, spike_generator_type, **params)
File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/brainsim/common/__AbstractCommunicationAdapter.py”, line 92, in __register_device
device.connect(populations)
File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/brainsim/pynn/devices/__PyNNPoissonSpikeGenerator.py”, line 193, in connect
“label”))
File “/home/ben/.opt/platform_venv/lib/python2.7/site-packages/pyNN/nest/projections.py”, line 47, in init
space, label)
File “/home/ben/.opt/platform_venv/lib/python2.7/site-packages/pyNN/common/projections.py”, line 95, in init
assert len(valid_types) > 0
TFLoadingException: wavetest: ‘’ (TF Loading Exception)
(<class ‘hbp_nrp_cle.tf_framework.TFLoadingException’>, TFLoadingException(’’,), <traceback object at 0x7fc77027b830>)
[ERROR] [1517740479.181485]: Error processing request: wavetest: ‘’ (TF Loading Exception)
[‘Traceback (most recent call last):\n’, ’ File “/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py”, line 625, in _handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n’, ’ File “/home/ben/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/ROSCLESimulationFactory.py”, line 222, in create_new_simulation\n launcher.initialize(environment_file, self.except_hook)\n’, ’ File “/home/ben/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/SimulationAssembly.py”, line 120, in initialize\n self._initialize(environment, except_hook)\n’, ’ File “/home/ben/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/CLEGazeboSimulationAssembly.py”, line 427, in _initialize\n self.__load_tfs()\n’, ’ File “/home/ben/Documents/NRP/ExDBackend/hbp_nrp_cleserver/hbp_nrp_cleserver/server/CLEGazeboSimulationAssembly.py”, line 663, in __load_tfs\n nrp.set_transfer_function(tf_code, new_code, tf.name)\n’, ’ File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/tf_framework/init.py”, line 355, in set_transfer_function\n config.active_node.initialize_tf(tf)\n’, ’ File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/tf_framework/_TransferFunctionManager.py”, line 208, in initialize_tf\n tf.params[i] = tf.params[i].create_adapter(self)\n’, ’ File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/tf_framework/_Neuron2Robot.py”, line 136, in create_adapter\n **self.config)\n’, ’ File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/brainsim/common/__AbstractCommunicationAdapter.py”, line 107, in register_spike_source\n device = self.__register_device(populations, spike_generator_type, **params)\n’, ’ File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/brainsim/common/__AbstractCommunicationAdapter.py”, line 92, in __register_device\n device.connect(populations)\n’, ’ File “/home/ben/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/brainsim/pynn/devices/__PyNNPoissonSpikeGenerator.py”, line 193, in connect\n “label”))\n’, ’ File “/home/ben/.opt/platform_venv/lib/python2.7/site-packages/pyNN/nest/projections.py”, line 47, in init\n space, label)\n’, ’ File “/home/ben/.opt/platform_venv/lib/python2.7/site-packages/pyNN/common/projections.py”, line 95, in init\n assert len(valid_types) > 0\n’, “TFLoadingException: wavetest: ‘’ (TF Loading Exception)\n”]

Let me know if i can be of help,
thanks in advance,
Ben


Set Rate of Poisson Generator
#4

This seems to be a very odd error. The problem is that you apparently want to connect a Poisson generator to a neuron population that does not support any receptor types. Did you use a custom neuron model?

From the three error logs, the interesting one only is the first. The second log is an internal ROS log that somebody reset the connection but that happens basically because the Transfer Function initialization could not be completed. The third error is basically a propagation of the first one in the backend component.


#5

Hey,
no, i only used build-in types. And all of them in the most basic way (i guess).
From the initial post:

this is the only thing i do in my brain file related to the poisson neuron

and the following in my TF:

not much more to it im afraid…

Regards,
Ben


#6

Hi Ben,

yeah, now I see it. You are trying to connect a Poisson generator to a Poisson generator. That basically doesn’t work in nest, because the Poisson generator neuron model does not accept incoming spikes. I guess what you really want is to connect the TF to different neurons?

Best,

Georg


#7

Hey Georg,
yeah, i figured as much, but the NRP documentation is kind of quirky regarding that stuff… so i need a spike source in general (no need for anything special, no timings etc…); how would i go about it then? It seems if i switch the sim.SpikeSourcePoisson to something else (IF_curr_exp or comparable) (and keep the nrp.poisson in the TF), nothing happens (spiking wise).

Any advice?

Regards,
Ben


#8

You should indeed connect the TF using a Spike Source mapping to a neuron of your choice. The only thing, the default weight of a Poisson generator is pretty low and we only generate exactly one Poisson generator. For a IF_curr_exp neuron, this is by far not enough in order to achieve a meaningful effect because the weight is only 0.00015. What you can do is either change the weight of your Poisson generator (for example 5.0), use multiple Poisson generators or use a high firing rate (for example 1000). Using multiple Poisson generators is currently awful, we really need to change that. I will file a bug in the developer backlog for this, since it is also particularly easy to accomplish.

Or you could use other neuron models. The standard examples use IF_cond_alpha neurons, which are much easier to excite.