Dear Thierry,
I assume you are using NEST 2.20, not 2.2?
Noisy spike generators usually send individual realisations of random spike trains to each target. Therefore, the only way to record the same spike trains that actually enter the neurons
is to put parrot_neurons between the generator and the actual target and then connect the parrot to the target. A setup for multiple neurons would be like below. We need one parrot per actual neuron to get the individual spike trains.
N = 20
gen = nest.Create('sinusoidal_poisson_generator', params={'amplitude':50.,'rate':15.0 })
parrots = nest.Create('parrot_neuron', N)
neurons = nest.Create('ht_neuron', N)
rec = nest.Create('spike_detector')
receptors=nest.GetDefaults('ht_neuron')['receptor_types']
nest.Connect(gen, parrots)
nest.Connect(parrots, neurons, 'one_to_one', {'model': 'static_synapse',
'receptor_type':
receptors['AMPA'],
'weight':10.})
nest.Connect(parrots, rec)
Best,
Hans Ekkehard
--
Prof. Dr. Hans Ekkehard Plesser
Head, Department of Data Science
Faculty of Science and Technology
Norwegian University of Life Sciences
PO Box 5003, 1432 Aas, Norway
Phone +47 6723 1560
Email hans.ekkehard.plesser@nmbu.no
Home http://arken.nmbu.no/~plesser
On 03/01/2022, 11:09, "thierry nieus" <thierry.ralph.nieus@gmail.com> wrote:
Dear all,
first of all, happy new year!
I am using nest 2.2 (installed by conda) and I have set up a simple network of 20-100 neurons based on the ht_neuron model. I am
delivering some noise to all neurons with the sinusoidal_poisson_generator (I can switch to another) and the simulation produces the results I am looking for.
However I would like now to have a look at the spikes entering the network and therefore I need to access all events generated by
the random generator.
A sample of my code is:
import nest
receptors=nest.GetDefaults('ht_neuron')['receptor_types']
nest.CopyModel("sinusoidal_poisson_generator",'sin_pois',{'amplitude':50.,'rate':15.0 })
nest.CopyModel("static_synapse","AMPAnoise",{"receptor_type":receptors["AMPA"],"weight":10. })
neurons=nest.Create("ht_neuron",1)
noise=nest.Create('sin_pois',1)
g = nest.Create('sin_pois', 1)
# current pulse
dc_gen = nest.Create("dc_generator")
nest.SetStatus(dc_gen, {"amplitude": 20., "start": 400, "stop": 1050})
nest.Connect(dc_gen, neurons, 'one_to_one')
# recorders
detect_noise = nest.Create('spike_detector', 1)
nest.Connect(noise, neurons, 'one_to_one', syn_spec="AMPAnoise")
nest.Connect(noise, detect_noise, 'one_to_one')
''' the latest does not work
Creation of connection is not possible because:
All outgoing connections from a device must use the same synapse type.
'''
Is there a way to record those spikes ?
Thanks in advance for any help
Best