nengo-1.4 icon indicating copy to clipboard operation
nengo-1.4 copied to clipboard

Create an izhikevich Neuron

Open Vafa-Andalibi opened this issue 10 years ago • 5 comments

Hello,

I intend to create an ensemble with just 1 neuron but with izhikevich firing pattern. Could you please give me some hints?

Vafa-Andalibi avatar Nov 04 '14 11:11 Vafa-Andalibi

This should work, although I've never really used the Izhikevich neurons much. You can play around with the parameters of the neuron by passing arguments to the IzhikevichSpikeGenerator constructor.

import nef
from ca.nengo.model.neuron.impl import IzhikevichSpikeGenerator

net = nef.Network()
ens = net.make("test", 1, 1)
for n in ens.getNodes():
    n.setGenerator(IzhikevichSpikeGenerator())

drasmuss avatar Nov 04 '14 14:11 drasmuss

Thank you in advance for your answer, it works. However, in interactive plot, I can only get the plot for "value" and none of the "voltage grid" , "voltage graph" , "firing rate" , "spike raster" and "tuning curves" works for that ensemble. Do you know what is the reason?

Vafa-Andalibi avatar Nov 06 '14 10:11 Vafa-Andalibi

If you add this line to your code

for n in ens.getNodes():
    n.setGenerator(IzhikevichSpikeGenerator())
ens.redefineNodes(ens.getNodes()) # <------

then the spike raster will work. The voltage plotting wasn't working because of a bug in the IzhikevichSpikeGenerator; I just pushed a fix, so if you update your Nengo distribution it should work.

drasmuss avatar Nov 06 '14 16:11 drasmuss

Hello again , I have another question with regard to putting probe over a neuron with command line. Suppose the Ensemble name is ens and the neuron is selected in GUI, then I do as follows:

pr = ProbeImpl()
pr.connect('ens', that, 'rate', True)

First, I do not know why the probe doesn't show up in GUI (in a form of small triangle). Then I run the simulation for a couple of seconds. However, when I enter this command :

print pr.getData().getValues()

I just get an empty array. Do you have any idea what the problem is?

Vafa-Andalibi avatar Nov 15 '14 08:11 Vafa-Andalibi

The usual way to add probes is via

myNetwork.simulator.addProbe("ens", "rate", True)

See if that works for you.

drasmuss avatar Nov 15 '14 13:11 drasmuss