SpiNNakerManchester / sPyNNaker8

The PyNN 0.8 interface to sPyNNaker.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SpikeSourcePossion in short burst producing too many to oregualr burst.

Christian-B opened this issue · comments

Reported by 366anna@gmail.com

replicated with:

import spynnaker8 as p
p.setup(1)
simtime = 500
pop_src = p.Population(1, p.SpikeSourcePoisson(
rate=50, start=0, duration=simtime), label="src")
pop_src.record("spikes")
for i in range(250):
p.run(2)
spikes = pop_src.get_data("spikes")
print spikes.segments[0].spiketrains
p.end()

A work around would be to generate a list of spiketimes in python and pass these in using a SpikeSourceArray.

The above would then be:
import random
import spynnaker8 as p
p.setup(1)
simtime = 500
spiketimes = []
for i in xrange(500):
if random.random() < 0.05:
spiketimes.append(i)
pop_src = p.Population(1, p.SpikeSourceArray(spiketimes), label="src")
pop_src.record("spikes")
for i in range(250):
p.run(2)
spikes = pop_src.get_data("spikes")
p.end()
print spiketimes
print spikes.segments[0].spiketrains

This could be caused by the reuse of the same seed every run combine with the effect of some state.
Running:
import spynnaker8 as p
p.setup(1)
simtime = 500
pop_src = p.Population(1, p.SpikeSourcePoisson(
rate=50, start=0, duration=simtime), label="src")
pop_src.record("spikes")
for i in range(5):
p.run(100)
spikes = pop_src.get_data("spikes")
p.end()
print spikes.segments[0].spiketrains

== Gives 5 patterns of similar spiketimes

It looks like the seed isn't written during pause, and is then the original seed is re-read during resume. Unfortunately, the seed value changes as the random stream progresses, so this resets it.

Answer is to update store_poisson_parameters to write the seed back to SDRAM.

Fixed by SpiNNakerManchester/sPyNNaker#425 ; did some testing of a script with and without this change, writing of the same seed on resume causes the output spikes to be regular.