How to craete multilayer SNN in CARLsim?

35 views
Skip to first unread message

arnab roy

unread,
Feb 26, 2017, 5:32:35 AM2/26/17
to CARLsim: A GPU-accelerated Spiking Neural Network (SNN) Simulator
Hi,

I want to create a multilayer SNN in CARLsim. For an example I want to create 3 layer SNN, one input layer, one hidden and one output layer.
Could you please confirm whether my below steps are correct to design such network?

Grid3D gridin(100,1,1) ;// input layer with 100 neurons
Grid3D gridhid(300,1,1);//hidden layer with 300 neurons
Grid3D gridout(10,1,1); //output layer with 10 neurons

int gin=sim.createSpikeGeneratorGroup("input", gridin, EXCITATORY_NEURON);
int ghid=sim.createGroup("hidden", gridhid, EXCITATORY_NEURON);
int gout=sim.createGroup("output", gridout, EXCITATORY_NEURON);

sim.setNeuronParameters(ghid, 0.02f, 0.2f, -65.0f, 8.0f);
sim.setNeuronParameters(gout, 0.02f, 0.2f, -65.0f, 8.0f);

//connection between adjacent layers....can I create connections like that?...//
sim.connect(gin, ghid, "full", RangeWeight(0.05), 1.0f, RangeDelay(1), RadiusRF(3,3,1));
sim.connect(ghid, gout, "full", RangeWeight(0.05), 1.0f, RangeDelay(1), RadiusRF(3,3,1));

......
sim.setupNetwork();

//set up spike rates//
PoissonRate in(gridin.N);
in.setRates(30.0f);
sim.setSpikeRate(gin,&in);

//run simulation ////

Regards,
Arnab

Michael Beyeler

unread,
Feb 26, 2017, 9:53:57 AM2/26/17
to CARLsim: A GPU-accelerated Spiking Neural Network (SNN) Simulator
Hi Arnab,

For the most part, you got it right! Only two small things:
  • The dimensions specified in RadiusRF follows the Grid3D dimensions for the group. So, if you have you're using a 1D grid such as gridin(100,1,1), then you want your RadiusRF to read something like RadiusRF(n,1,1), where n defines the number of neurons in the neighborhood you want connected. For "full" or "all-to-all" connectivity, you can just drop the RadiusRF from the connect call for simplicity.
  • In order to run the simulation, you need a
    sim.runNetwork(1, 0)
    or similar (this will run the network for 1 second and 0 milliseconds).
Best,
Michael

Michael Beyeler

unread,
Mar 11, 2017, 7:28:45 PM3/11/17
to CARLsim: A GPU-accelerated Spiking Neural Network (SNN) Simulator
I'm happy to announce that there is now a Tutorial on how to set up spatial connectivity: https://uci-carl.github.io/CARLsim3/tut4_image_processing.html.
Reply all
Reply to author
Forward
0 new messages