Skip to content
This repository has been archived by the owner on Oct 31, 2020. It is now read-only.

Create an izhikevich Neuron #428

Open
Vafa-Andalibi opened this issue Nov 4, 2014 · 5 comments
Open

Create an izhikevich Neuron #428

Vafa-Andalibi opened this issue Nov 4, 2014 · 5 comments

Comments

@Vafa-Andalibi
Copy link

Hello,

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

@drasmuss
Copy link
Member

drasmuss commented Nov 4, 2014

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())

@Vafa-Andalibi
Copy link
Author

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?

@drasmuss
Copy link
Member

drasmuss commented Nov 6, 2014

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.

@Vafa-Andalibi
Copy link
Author

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?

@drasmuss
Copy link
Member

The usual way to add probes is via

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

See if that works for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants