Competitive learning in ANNarchy

66 views
Skip to first unread message

Nestor Rueda

unread,
Sep 14, 2016, 12:50:49 PM9/14/16
to ANNarchy
Dear all, thank you in advance, for all the information which ANNarchy team have given me. 

I try to develop a simple model of competitive learning but I have two questions:

1. I want set the inputs to population1(spiking neurons) periodically in a fixed duration trials. I am using SpikeSourceArray to set the inputs,  Can it be done as follows?




spikeTrain = getSpikeTrain(nNeurons)
sTrain = SpikeSourceArray(spikeTrain)

learP = Population(nNeurons, neuron=ann.IF_cond_alpha)
projlpNet = Projection(pre=sTrain, post=learP, target='exc', synapse = STDP)
projlpNet.connect_all_to_all(weights=1.0)

compile()

for trial in range(10):
    sTrain.spike_times = getSpikeTrain(nNeurons)
    simulate(5.0)


2. I want to develop a competitive learning model as (Masquelier et al. 2009) but I do not know if the next model can be implemented in ANNarchy:
(see attachment picture)

As the picture show, a set of spike trains (may be generated through SpikeSourceArray) are the inputs to a population of neurons, then, if a neuron fires, it sends a inhibitory postsynaptic potential to its neighbors. The next code doesn't work correctly, and I believe that is wrong. Can I implementing this recurrent inhibitory behaviour in ANNarchy?

spikeTrain = getSpikeTrain(nNeurons)
sTrain = SpikeSourceArray(spikeTrain)

learP = Population(nNeurons, neuron=IF_cond_alpha)
projlpNet = Projection(pre=sTrain, post=learP, target='exc',  synapse = STDP)
projlpNet.connect_all_to_all(weights=1.0)
projlpNet = Projection(pre=learP, post=learP, target='inh', synapse = STDP)
projlpNet.connect_all_to_all(weights=1.0)


Could you help me with the above questions? 

Thanks again to all,

All the best, 
CompetitiveLearning.png

Julien Vitay

unread,
Sep 14, 2016, 1:17:44 PM9/14/16
to ANNarchy
Hi Nestor,

1. Unfortunately, in a SpikeSourceArray, you need to provide the absolute time of the spikes, they are not relative to each call to simulate(). I will think about a way to allow relative spike times, but meanwhile I think it is faster if you modify your getSpikeTrain method so that it takes a reference time (what would be t=0 for your periodic input, but may be 0, 5, 10, 15ms... inside your loop) and adds it to all the spike times. You can access the current time with get_time() in ANNarchy.

2. I see nothing wrong about the code, it reflects the picture. What is not working exactly? I'll try to have a look at the Masquelier paper, it could be a nice example for ANNarchy.

Best
Julien

Nestor Rueda

unread,
Sep 14, 2016, 6:08:09 PM9/14/16
to ANNarchy
Hi Julien, thank you for your fast reply.

It would be great allow relative spike times, but meanwhile, I will set the inputs of population periodically in a loop. 

May be the competitive learning example didn't work for a misuse of SpikeSourceArray. I will fix it.

I have attached a copy of Masquelier's paper, may be helpful. Would be a good example for ANNarchy.

All the best,

Nestor.
Competitive STDP-Based Spike Pattern Learning - 2009.pdf

Julien Vitay

unread,
Nov 20, 2016, 4:06:12 PM11/20/16
to ANNarchy
Hi,

sorry it took so long.... SpikeSourceArray now can be reset, so the spike times are relative:

for trial in range(10):
    sTrain.reset()
    simulate(5.0)

There is now a documentation in the manual on how to set inputs:


It is still in the develop branch, will be integrated to the 4.6.0 release.

Best
Julien
Reply all
Reply to author
Forward
0 new messages