Picking Out Patterns (pt. 1)

Hello!

The neural-network simulation I’m working with does output an array of spike times for each neuron. Rereading through the reference paper, though, that’s useful only if you can correlate it to a particular input; each input (pattern of stimulation based on sensor values) is correlated to a particular pattern of spiking, which is then translated into the action-command for the robot.

Since I can’t (or haven’t yet figured out how to) ‘stimulate’ the neuronal network I’m working with, I thought it might be a good idea to just choose a random pattern and see if I could write code to pick it out.

Here’s the situation I’ve decided on: neurons in the simulation (I’m now using 12) will spike, and I’ll get an output of all their respective spike times. Then I intervene and pick the three with the most spiking. Tell me at what time all three are spiking together.

To start, here’s the simulation command:

 W = log(abs(randn(12)));
[spk NetParams V] = SimLIFNet(W,'simTime',35,'tstep',1e-2,...
'offsetCurrents',1.1*ones(length(W),1));

Here’s the array of spike times:

spk =

[ 2.3900]
 [ 2.3900]
 [1x17 double]
 [1x18 double]
 [1x2 double]
 [ 2.3900]
 [ 2.3900]
 [ 2.3900]
 [1x19 double]
 [ 2.3900]
 [1x2 double]
 [ 2.3900]

 

Okay, so I’ve decided to use the 3rd, 4th, and 9th neurons. Now I’ll make new arrays of just those to make it more convenient:

for c = 1:17
neuronOne(c) = spk{3,1}(c);
end

for c = 1:18
neuronTwo(c) = spk{4,1}(c);
end

for c = 1:19
neuronThree(c) = spk{9,1}(c);
end

Here’s what that output looks like, rounded:

A = round(neuronOne, 1)

A =

Columns 1 through 7

2.4000 9.5000 10.8000 12.5000 14.2000 15.8000 17.5000

Columns 8 through 14

19.1000 20.7000 22.3000 24.0000 25.6000 27.2000 28.8000

Columns 15 through 17

30.5000 32.1000 33.7000

and

B = round(neuronTwo, 1)

B =

Columns 1 through 7

2.4000 8.7000 10.5000 12.1000 13.7000 15.3000 16.9000

Columns 8 through 14

18.6000 20.2000 21.8000 23.5000 25.1000 26.7000 28.3000

Columns 15 through 18

30.0000 31.6000 33.2000 34.8000

and

C = round(neuronThree, 1)

C =

Columns 1 through 7

2.4000 6.2000 8.5000 9.9000 11.4000 13.0000 14.6000

Columns 8 through 14

16.3000 17.9000 19.5000 21.1000 22.8000 24.4000 26.0000

Columns 15 through 19

27.6000 29.3000 30.9000 32.5000 34.2000

 

Great. Now I’m going to try and find the intersection of those three arrays:

out = intersect(A, intersect(B, C))

out =

2.4000

Shucks. Just one?

To make sure this wasn’t because of a problem with the code, I tried this to see if I could get more than just one result lol:

D = round(neuronTwo)

D =

Columns 1 through 12

2 9 10 12 14 15 17 19 20 22 23 25

Columns 13 through 18

27 28 30 32 33 35
E = round(neuronThree)

E =

Columns 1 through 12

2 6 8 10 11 13 15 16 18 20 21 23

Columns 13 through 19

24 26 28 29 31 33 34
outBC = intersect(B, C)

outBC =

2 10 15 20 23 28 33

Hooray! It works!

I’d then potentially put a robot-action command here, to be executed at these time-stamps.

So the next step would be figuring out how to account for time-delays. (Like what if the pattern is that one neuron spikes, then x time later another spikes, and then somewhere in the middle there’s a third spike?)

To test this, I used sorted data from an actual MEA, but the idea remains the same… I just had all the channels already sorted out into individual arrays, so it didn’t require all the pre-processing.

Side note: channel-activity doesn’t necessarily correlate to a single neuron. The reference paper, however, uses what it calls ‘perceptrons’ to correlate an input stimulation to output activity. Because the same pattern of activity (not necessarily the neurons) just needs to detected each time the culture is stimulated, channels will do.

This is my easy fix to adding a time-delay (again, all the channels were rounded), with a nice photo of the ch_20a array as proof it works :).

intersect(ch_20b, intersect(ch_01a, ch_20a+1)) 
%do you see the +1? that's the 'add a time-step'!

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *