Monitoring Membrane Potential and others parameters in the NRP


#1

Dear NRP developers/users:

I have the next problem. I am trying to monitor the membrane potential in the NRP and the output array is empty. I have seen the other posts in this forum and nothing works for me. I have the following code.

In the brain model, I record the parameters that I want:
GranularLayer.record((‘spikes’,‘v’, ‘gsyn_exc’,‘gsyn_inh’))

In one TF, I would like to acces to ‘v’ param for example:
clientLogger.info(str(nrp.config.brain_root.GranularLayer.get_data().segments[0].filter(name=“v”)[0]))

When I run the simulation I have the next error message:
linear_twist:13: ‘segments’ has no attribute ‘analogsignalarrays’

I don’t have any circuit. In my brain model, I have four layers. In some cases, the simulation get me back a empty array. This occurs with the MossyFiber layer. In the Granular layer, I have the previous error.

I have tried this code out of the NRP and everything works fine. Does anyone know why this is due to?

Thanks for all.

Best regards,
Juan Carlos.


#2

Hi Juan Carlos,

could you share more of your code? In particular, I do not have any idea where that analogsignalarrays access comes from. Without that, a diagnosis of the problem will be difficult.

However, let me try: One thing that I can imagine causes trouble is that the NRP internally reuses the spike recorder that is created by PyNN for each population. However, because PyNN 0.8 uses neo objects to report the spikes and these neo objects are a performance nightmare if you require them every 20ms, we bypass PyNN and query the events from the underlying nest device directly, at least if we are sure that we run with nest (nest.GetStatus(device, ‘events’)[0]). In order to not run into a ramp, we reset the events of that nest device after each turn (nest.SetStatus(device, ‘n_events’, 0)). I am actually not exactly sure about the implementation details of PyNN.nest, but maybe this also resets the recordings for the membrane potential measurements.

If this assumption is correct, then you could try to not record the population by a spike recorder and then the events would not be deleted and you see the membrane potentials. If you suceed with that, maybe we can work together to create a membrane potential meter device type in the NRP.

The fact that you do not have a circuit is not a problem. A circuit population is only required for explicit population definitions such as at the top of the brain editor and we basically plan to erase them anyhow, so not having a circuit is absolutely fine.

Best regards,

Georg


#3

For error diagnosis: If you run the platform locally, I would also be interested in the logs, perhaps there is a traceback for the error that you encountered.


#4

Dear Georg,

Please could you open a ticket in the PyNN issue tracker explaining the performance problems the NRP is having with PyNN’s use of Neo?

(If we don’t know about the problems, we can’t fix them :wink:

Best regards,

Andrew


#5

Hi Andrew,

yes, I can. In short: The NRP essentially still uses the PyNN 0.7.5 format of spike trains that consist of a two-dimensional numpy array reporting on the neurons that spiked and the precise spike times. The neo objects basically have to be reshaped and the data has to be copied, causing a lot of overhead.

When we went to PyNN 0.8 and nest 2.8/2.10, we we essentially concluded that PyNN was made for analyzing the spike data after a complete simulation and we simply have a different use case. When you only assembly a neo object once, then the overhead for it is well justified as it makes analysis easier. If you query the data every 20ms and you know the structure of that data very well, then assembling a neo object just to disassemble it afterwards does not make that much sense. Therefore, I think that the decision to work with neo objects is absolutely fine for the main purpose of PyNN, especially having analysis tools such as elephant in mind, but for the NRP, the neo objects are an overkill.

If you really want to support that use case in PyNN, I think this would require an entirely new API where you can basically choose whether you want to record rich data that is going to be used in an analysis of a long-running batch simulation, or if you just want to have the raw data because you are running an interactive simulation.

Best regards,

Georg


#6

Concerning the error message about analogsignalarrays, one possibility is that the NRP has updated to Neo 0.5 but has not updated to PyNN 0.9.

(Note that version 0.9 of the PyNN API is identical to 0.8, except that it uses the Neo 0.5 object model, which is not backwards compatible with previous versions).


#7

The latest version 1.2.1.dev0 of the NRP still uses PyNN 0.8.2 and neo 0.4.0, but that version conflict information is good to know.


#8

Thanks @georg.hinkel for the support. I’ve tried to delete the recorder and nothing has been fixed. The membrane potential array is empty. I am using the code of the husky experiments to do some tests. My code is:

@nrp.MapSpikeSink(“left_wheel_neuron”, nrp.brain.DeepCerebellarNuclei[3], nrp.leaky_integrator_alpha)
@nrp.MapSpikeSink(“right_wheel_neuron”, nrp.brain.DeepCerebellarNuclei[4], nrp.leaky_integrator_alpha)
@nrp.Neuron2Robot(Topic(’/husky/cmd_vel’, geometry_msgs.msg.Twist))
def linear_twist(t, left_wheel_neuron, right_wheel_neuron):

 clientLogger.info(str(nrp.config.brain_root.GranularLayer.get_data().segments[0].filter(name="v")[0]))
 return geometry_msgs.msg.Twist(
    linear=geometry_msgs.msg.Vector3(x=20.0 * min(left_wheel_neuron.voltage, right_wheel_neuron.voltage), y=0.0,
                                     z=0.0), angular=geometry_msgs.msg.Vector3(x=0.0, y=0.0, z=100.0 * (
        right_wheel_neuron.voltage - left_wheel_neuron.voltage)))

In the brain file, I don’t record anything. The array which clientLogger shows is empty.

I’ve seen other ways to show neuronal information like the Neuron2Monitor TF but I don’t know how to use it since in the NRP documentation I don’t find this information. I know how to show the spike times but, is it possible to show other information in this TF? Can I use the neuron2monitor TF instead of the clientLogger?


#9

The NeuronMonitor is essentially a TF that outputs to a given monitoring topic that is also used by the NRP frontend to show spike trains. The purpose of this class is that users do not have to know the NRP internals how to send monitoring data that is interpreted by the frontend.

However, a NeuronMonitor also internally uses a spike recorder. So if you have a monitor on GranularLayer, then this would also interfere with the membrane potentials.


#10

Thanks @georg.hinkel. How can I use this monitor? In some examples, I’ve seen that the monitor access, for example, to the spike times but, how can I access to the membrane potential or other params?


#11

For error diagnosis: If you run the platform locally, I would also be interested in the logs, perhaps there is a traceback for the error that you encountered. my blog: طراحی سایت


#12

@georg.hinkel hi thank you … سازوکار


#13

great good luck TF that outputs to a given monitoring topic that is also used by the NRP frontend to show spike trains.

فرش دستباف اصفهان


#14

mayby clientLogger.info(str(nrp.config.brain_root.GranularLayer.getdata().segments[0].filter(name=“v”)[1]))
دیجیتال مارکتینگ


#15

Thank you for saying this because I had a similar problem
Thank you dear users for their helpful tips
طراحی سایت تهران
بهینه سازی سایت