From: Mathieu D. <mat...@li...> - 2008-06-30 07:45:53
|
Hello Dejan, I wanted to use a ConnectionsProjection because I would like to make a function which look more or less like this: plot(net, subpopulations, connections, subpop_style, connection_style) This way it is easy to assign one style to each population (for instance input neurons in blue, liquid neurons in red and so on) and to each type of connections (also I think this is the best to describe a network). Thank you for your help. I will continue to work on this those days and keep you in touch. Mathieu Pecevski Dejan wrote: > Mathieu Dubois wrote: >> I want to build (and plot) the same LSM than in [1] (very similar to >> the one given in the Circuit-Tool tutorial). >> I have created the liquid neurons as a spatial population with 2 >> families: >> liquid_nrn_popul = SpatialFamilyPopulation( net, [ exc_nrn_factory, >> inh_nrn_factory ], RatioBasedFamilies( EXC_INH_Ratio ), >> CuboidIntegerGrid3D(LIQUID_SIZE, LIQUID_ORIGIN) ); >> so I can make the connections inside the liquid with a >> ConnectionsProjection and draw those synapses with the help you gave me. >> >> But for connecting (for instance) the input neurons to the liquid I >> use net.connect (as in the examples) so I cannot use a >> ConnectionsProjection (each input neuron is connected to the three >> liquid neurons at the same altitude). >> > It's not clear to me why you want to use a ConnectionsProjection? > If I understood correctly, the connection map from input to the liquid is > predefined, you already know which neurons to connect in the plot, so you > probably don't need this to get the presynaptic and postsynaptic > neuron pairs. > > If you want to get the parameters of the synapses you can achieve this > with > the synapses IDs. > > When you execute > > syn_id = net.connect( pre_nrn_id, post_nrn_id, StaticSpikingSynapse() ) > > for example, then the output of net.connect is the id of the synapse > created. > Now you can get this synapse with > > net.object(syn_id) > > regards, > Dejan >> I think that I can define a new sub-population in the liquid with the >> function subset (and therefore use a ConnectionsProjection) but I >> cannot figure out how to do that with the online help. >> So my question is: How to define a subpopulation? >> > You can define a new population by giving a list of IDs of the > simobjects: > > --------------- > > exz_nrn_popul = SimObjectPopulation(net, lifmodel, int( nNeurons * > Frac_EXC ) ); > inh_nrn_popul = SimObjectPopulation(net, lifmodel, nNeurons - > exz_nrn_popul.size() ); > > all_nrn_popul = SimObjectPopulation(net, > list(exz_nrn_popul.idVector()) + list(inh_nrn_popul.idVector())); > > print "Created", exz_nrn_popul.size(), "exz and", > inh_nrn_popul.size(), "inh neurons"; > ------------ > See example : > http://www.lsm.tugraz.at/pcsim/examples/cuba_model_populations.py > > You can extract the ids of the neurons in the liquid that the input > neurons connect to, with > id = liquid_popul.getIdAt( 3,4,5 ).packed() > > make a python list of these ids > and then call > > new_popul = SimObjectPopulation( net, id_list ) > > And then you can create the wanted projections between populations. > > I hope that's helpful. > > regards, Dejan > >> Thanks in advance, >> Mathieu >> >> [1] "Imitation Learning with spiking networks and real-world >> devices", H. Burgsteiner, Engineering Applications of AI, 19, >> 741-752, 2006 >> >> > |