question regarding to 2015orchestrated

Request or post your example code here
Post Reply
nsf2000
Posts: 16
Joined: Thu Nov 05, 2015 2:35 pm

question regarding to 2015orchestrated

Post by nsf2000 »

Hello,

I have several questions regarding to 2015 orchestrated paper. I would appreciate if any one can provide any hints. And Sorry for any naive questions since I am starter in this area.

I think I have successfully reproduce the paper results shown below which is similar as figure 3 in the paper. [img1.jpg][/img1.jpg]

Then, what I did is retrain the neural network on more patterns (num.pat, 0-9 10 digits in printed format, sizes 28x28 pixals). and test on noisy dataset (mnist.pat, mnist hand written recognition, also 28x28). However, after running the entire run_orchestrated_stdp.sh. I found that the .pact results are totally mess. in the 1run_init, 2run_learned, 3run_cued, I changed the origin shapes.pat to my num.pat, and change the shapes_cued.pat to be my mnist.pat). Here are my questions:

1. I found that in the origin repository 1run_init use a monf file which named as rf1.pat. the rf1.pat contains 4 patterns. How I suppose to generate it in my case since I need to retrain the network with 10 different patterns? I saw the bootstrap.sh which run prior others contains the 1run_init.sh and generate the new rf1.pat file. however, 1run_init.sh need rf1.pat as input monf file, so if I remove the origin rf1.pat, I will get the error from rassta.py.

2. I was also confused on the .pact file. Based on the auryn web wiki: the first column is the time, the 2nd, 4th, 6th.... is the "population firing rate of a given population as well as the running overlap of the network activity". I am not quite get it. how can we know which group of neuron corresponding which patterns? I would appreciate if you can provide how to calculate the 2nd column and 3rd column (Since the source code was too long and too many hierarchy, I haven't get clues yet from the auryn library).

3. If I used 28*28 pixal image, should I change the neural size to be 28*28 excitatory neuron and 28*7 inhibitory neuron? or it doesn't matter when I use large network.

4. final question is I was curiosity how the sparse connection worked. I saw in the source code, it seems that sparse random connection is achieved by connect_block_random function. and it looks like generate random matrix to represent synapse connection. Am I understand correctly here? if this is the case, it is possible that some group of neuron is not connected with the network, correct?

Thank you very much! and sorry for any naive questions
Attachments
img1.jpg
img1.jpg (198.49 KiB) Viewed 11794 times
User avatar
zenke
Site Admin
Posts: 156
Joined: Tue Oct 14, 2014 11:34 am
Location: Basel, CH
Contact:

Re: question regarding to 2015orchestrated

Post by zenke »

nsf2000 wrote: 1. I found that in the origin repository 1run_init use a monf file which named as rf1.pat. the rf1.pat contains 4 patterns. How I suppose to generate it in my case since I need to retrain the network with 10 different patterns? I saw the bootstrap.sh which run prior others contains the 1run_init.sh and generate the new rf1.pat file. however, 1run_init.sh need rf1.pat as input monf file, so if I remove the origin rf1.pat, I will get the error from rassta.py.
Hi,
normally you can start with any Monitor File (monf). You can start with an empty one too, just don't remove it if you want to use the script. You can also write a new script and leave the --monf argument out. Either will only affect the output of the pattern activity files (pact). The procedure in bootstrap.sh generates a new rf1.pat from the spiking output and the stimulus times which are stored in the *.stimtimes files.
nsf2000 wrote: 2. I was also confused on the .pact file. Based on the auryn web wiki: the first column is the time, the 2nd, 4th, 6th.... is the "population firing rate of a given population as well as the running overlap of the network activity". I am not quite get it. how can we know which group of neuron corresponding which patterns? I would appreciate if you can provide how to calculate the 2nd column and 3rd column (Since the source code was too long and too many hierarchy, I haven't get clues yet from the auryn library).
The formatted file output from PatternMonitor is generated in the functin propagate() in the file src/PatternMonitor.cpp
The overlap columns use a different normalization in that they count active neurons (at least one spike in recording interval) instead of total number of spikes. Since this regularly confuses people this feature will be removed in one of the next versions.
nsf2000 wrote: 3. If I used 28*28 pixal image, should I change the neural size to be 28*28 excitatory neuron and 28*7 inhibitory neuron? or it doesn't matter when I use large network.
Depends on what you are trying to do. The network needs a certain critical size to sustain delay activity. A smaller network is likely not to exhibit selective delay activity. If you use 28 by 28 inputs you are effectively only using one quarter of all the input neurons. Learning dynamics are sensitive to whether cells in the network "make it across the LTD/LTP threshold" which lies at around 10Hz. If you make your stimuli smaller by one quarter you have to somehow compensate for this lack of input. An easy workaround could be to just tile the 28*28 inputs four times to get close to 64*64, but it's something you have to try.
nsf2000 wrote: 4. final question is I was curiosity how the sparse connection worked. I saw in the source code, it seems that sparse random connection is achieved by connect_block_random function. and it looks like generate random matrix to represent synapse connection. Am I understand correctly here? if this is the case, it is possible that some group of neuron is not connected with the network, correct?
The default constructor of SparseConnection initializes the matrix as one large random block. That's why it uses connect_block_random internally. For more information how the connections are drawn efficiently see this post http://www.fzenke.net/auryn/forum/viewt ... cs#p121.So typically you will not get any unconnected neurons -- or at least this is very unlikely. I believe there is a function sanity_check() also in SparseConnection which checks for unconnected singular units. Better even, you can visualize the matrices by exporting them to Matrix Market format and directly look at them to convince yourself about what's going on.

In sim_rc_p10c.cpp try adding the lines

Code: Select all

    sprintf(strbuf, "%s/%s.%d.ee.wmat", dir.c_str(), file_prefix.c_str(), world.rank() );
    con_ee->write_to_file(strbuf);
just before

Code: Select all

logger->msg("Freeing ...",PROGRESS,true);
delete sys;
at the end of the file.

This will generate two Matrix Market compatible files per rank. The first one with the filename you specify. It contains the weights. The second one gains an extension cstate. It is yet another sparse matrix which contains the consolidation variable w tilde. In both cases the format is human readable and self explanatory. You can load them in Python or Matlab and add these n matrices together to get the complete weight matrix and them plot it and do some more fancy stuff such as looking for assemblies...

Some more info and code examples on this
https://www.fzenke.net/auryn/doku.php?id=manual:wmat
http://math.nist.gov/MatrixMarket/
nsf2000 wrote:Thank you very much! and sorry for any naive questions
No problem. It's a complicated network. I hope I could answer your questions. Good luck with MNIST -- it is going to be tough one. Maybe start with only 2 or 3 digits in the beginning ...
User avatar
zenke
Site Admin
Posts: 156
Joined: Tue Oct 14, 2014 11:34 am
Location: Basel, CH
Contact:

Re: question regarding to 2015orchestrated

Post by zenke »

Hey I ran a test with 20 patterns over night and the script ran through without a problem. I used an empty rf1.pat to start with. Here is the output from this run:

Code: Select all

make: Entering directory `/home/zenke/projects/pub2015orchestrated/src'
make: `sim_rc_p10c' is up to date.
make: Leaving directory `/home/zenke/projects/pub2015orchestrated/src'
simulation prefix rf1.
simulation prefix rf1.
simulation prefix rf1.
simulation prefix rf1.
( 0) Setting up stimulus ...
[=========================] 100%      t=3600.0s  f=1.7 Hz
( 0) Freeing ...
Generating trigger file
Create human-readable ras file from binary output files
Computing PSTH...
Setting thr 0.0
windowsize 0.50s
Scanning ras file ...
161 triggers scanned
 - 4 counts in 0
 - 6 counts in 1
 - 8 counts in 2
 - 7 counts in 3
 - 8 counts in 4
 - 6 counts in 5
 - 9 counts in 6
 - 11 counts in 7
 - 8 counts in 8
 - 7 counts in 9
 - 9 counts in 10
 - 6 counts in 11
 - 7 counts in 12
 - 8 counts in 13
 - 7 counts in 14
 - 12 counts in 15
 - 11 counts in 16
 - 10 counts in 17
 - 6 counts in 18
 - 11 counts in 19
plotting...
Generating pattern file...
Threshold is 10
done
make: Entering directory `/home/zenke/projects/pub2015orchestrated/src'
make: `sim_rc_p10c' is up to date.
make: Leaving directory `/home/zenke/projects/pub2015orchestrated/src'
simulation prefix rf1.
simulation prefix rf1.
simulation prefix rf1.
simulation prefix rf1.
( 0) Setting up stimulus ...
[=========================] 100%      t=3600.0s  f=1.7 Hz
( 0) Freeing ...
make: Entering directory `/home/zenke/projects/pub2015orchestrated/src'
make: `sim_rc_p10c' is up to date.
make: Leaving directory `/home/zenke/projects/pub2015orchestrated/src'
simulation prefix rf2.
simulation prefix rf2.
simulation prefix rf2.
simulation prefix rf2.
( 0) Setting up stimulus ...
( 0) Loading from file ...
[=========================] 100%      t=3600.0s  f=2.0 Hz
( 0) Freeing ...
make: Entering directory `/home/zenke/projects/pub2015orchestrated/src'
make: `sim_rc_p10c' is up to date.
make: Leaving directory `/home/zenke/projects/pub2015orchestrated/src'
simulation prefix rf3.
simulation prefix rf3.
simulation prefix rf3.
simulation prefix rf3.
( 0) Setting up stimulus ...
( 0) Loading from file ...
[=========================] 100%      t=3600.0s  f=4.2 Hz
( 0) Freeing ...
Here I used the shape_cues.pat as input and it is obviously not guaranteed that network does indeed learn anything useful from these inputs. However, rf1.pat has 20 entries and you can already guess there is some block structure in the covariance matrix of these patterns, corresponding to the underlying 4 classes and random patterns.
Covariance matrix of rf1.pat after learning during phase 1 with the cue file.
Covariance matrix of rf1.pat after learning during phase 1 with the cue file.
rf1pat_corr.png (18.67 KiB) Viewed 11772 times
nsf2000
Posts: 16
Joined: Thu Nov 05, 2015 2:35 pm

Re: question regarding to 2015orchestrated

Post by nsf2000 »

Hi Zenke,

Thank you very much for your reply! I apologize some simple questions due to my limited knowledge, since I am quite fresh in this area.

I actually tried wmat file, load into the python, after I add multiple rank weights value, I plot the weight matrix value which look like the following Figure 1. I was wondering how to check the cell assembly in such case (I originally thought I can only see it in the ras file and pact file).

Also what is the differences between monf file and stim file? if the monf file leave it as empty, is that mean I need to observe the patterns through .prate file, correct? I think what I am missing is that how can I check cell assemble.

Finally, I am a little bit confused on the population firing rate in pact file. I know the each column is the fired neuron number, but How can we know which firing neuron corresponding to which patterns? (for example, in the origin pact file, 2nd column is the pattern 1 population firing rate)

Thank you so much!
Sufeng
Attachments
figure.jpg
figure.jpg (176.62 KiB) Viewed 11768 times
User avatar
zenke
Site Admin
Posts: 156
Joined: Tue Oct 14, 2014 11:34 am
Location: Basel, CH
Contact:

Re: question regarding to 2015orchestrated

Post by zenke »

Hi!
The logic is the following: There is a pool of input neurons (StimulusGroup) which we control as our external world. Which neurons fire together in this pool is controlled by the stim file. So the stim file controlls the input. Structually it is a pat file (https://www.fzenke.net/auryn/doku.php?id=manual:pat) because it just characterizes groups of neurons. Now the monitor file (monf) controls which neurons we are reading out from the excitatory neuron population in the network (neurons_e). The monitor file is a pat file again, because one more time it just characterizes groups of neurons active together. You can think of the stim file as characterizing the input of the system and the monf as describing the output populations (neurons which are active together) from within the network. Now the stim file is fixed by the stimuli you want to give. The monf needs to be rebuilt to accommodate that the network assignment to which neurons respond most to which stimulus depends on multiple factors and is in fact quite random. That's the logic of the simulation.

Now the way I am building the file is described in detail in this thread http://www.fzenke.net/auryn/forum/viewt ... ?f=10&t=29

In short the logic is. We record the activity of all neurons during stimulation and establish to which stimulus they respond most. This is done by computing the PSTH for each stimulus. Then we define a threshold for average activity during stimulation (10Hz) and neurons above that threshold are characterized as responsive for stimulus x. These are the neurons summarized in the rf1.pat file. There are four groups of them because there are four stimuli. Now in principle these groups can be overlapping or even the same if the network confuses multiple stimuli. If you want to see if assemblies are formed you need to measure the mean weight between cells which have the same preferred stimulus. Since you have the wmat file and the rf1.pat file you have all the information you need to compute this. See for instance Figure 3i and methods in the paper. Hope that helps.

Best,

F
nsf2000
Posts: 16
Joined: Thu Nov 05, 2015 2:35 pm

Re: question regarding to 2015orchestrated

Post by nsf2000 »

Thank you so much! Now I understand the logic here. I found that the last a few paragraphs in the paper also gave the clues. I will go through the other thread and paper. Thank you again for your answer!

Best,
Sufeng
nsf2000
Posts: 16
Joined: Thu Nov 05, 2015 2:35 pm

Re: question regarding to 2015orchestrated

Post by nsf2000 »

Hello,

Sorry, I got another questions regarding to the monf file which is based on computing PSTH. I found that after using bootstrap.sh to generate the rf1.pat file (my stimuli has 10 patterns, each 28 by 28), for each pattern in rf1.pat the number of firing neuron is very small amount. In my case, for each pattern, it only has 15 neuron fired, and I found the original 4 pattern version has nearly 600 neuron fired per patterns. I guess that is one of reasons why I am getting the wrong results on the pact file. Do you have any clues on this issue?

I am guessing the problem comes from possion neuron size since it only maps to a 28 by 28 neuron size

Thank you
Sufeng
Post Reply