Auryn is using its own tailored sparse matrix class which might not be well adapted to interact with eigen or armadillo. By now there are functions in place to do what you would like to do efficiently. What you might want to look into is the load_pattern method in SparseConnection.
Suppose you want to store a pattern such as I did in Vogels et al. Fig 4, you simply need to figure out the neuron indices you would want within that pattern. These indices you simply store as a list in text format in a file. In Auryn these files have the extension .pat for "pattern file" (you can store more than one pattern per file; see http://www.fzenke.net/auryn/doku.php?id=manual:pat
Say you want neurons 1,3,5,8,9 in a pattern and 2,4,8,10 in a second, the pat-file would like like this.
Let's assume this file is called mytwopatterns.pat. To add these assemblies on top of your random connectivity in your connection con_ee, all you need to do is call
Code: Select all
where lambda is the strength that is added to any affected synapses. Note, you can also run load_patterns in overwrite mode in which synaptic weights will be set equal to lambda.
Pat files can additionally have a second column with a gamma parameter between zero and one which signifies the strength. When omitted gamma is assumed 1. With gamma values you can create graded attractor patterns in your cell assemblies as is shown in one of my bigger simulations which were released in the press package along with Vogels et al. 2011. Here you find one example of what you can do with it http://fzenke.net/uploads/images/movies ... _Large.mov
To create patterns I usually draw them in Gimp or any graphics tool, then save them to JPG (I convert them to grayscale first I should say). You can convert them to the format Auryn understands by a few line of python code along these lines
Code: Select all
import matplotlib.image as mpimg
import numpy as np
img = img.ravel()
img = np.array(img,dtype=float)
img /= 255.0
thr = 0.5
print "# Pattern loaded from file ", filename
for c in np.argwhere(img):
i = c
val = img[i]
print "%i %f"%(i,1.*val)
I hope that helps!