Auryn simulator

Simulator for spiking neural networks with synaptic plasticity

User Tools

Site Tools


examples:sim_epsp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
examples:sim_epsp [2014/01/10 19:10] – created zenkeexamples:sim_epsp [2016/08/11 07:37] (current) – Removes full prog zenke
Line 24: Line 24:
 In the default configuration of the simulation the [[manual:ras]] file stays empty since the neuron does not emit any spikes. The [[manual:mem]] file contains the trace of the membrane potential over time. The other files (with extensions ''ampa'',''gaba'' and ''nmda'') contain traces of the neuron's conductance variables. In the default configuration of the simulation the [[manual:ras]] file stays empty since the neuron does not emit any spikes. The [[manual:mem]] file contains the trace of the membrane potential over time. The other files (with extensions ''ampa'',''gaba'' and ''nmda'') contain traces of the neuron's conductance variables.
  
-===== Output example =====+==== Output example ====
  
 This plot shows the membrane potential of the single neuron in the simulation. This plot shows the membrane potential of the single neuron in the simulation.
  
-{{ :manual:epsp.png |}}+{{ :examples:epsp.png?300 |}}
  
 This plot can be generated by running gnuplot and issueing the follwing commands in the same directory This plot can be generated by running gnuplot and issueing the follwing commands in the same directory
Line 39: Line 39:
  
 ===== The importand bits ===== ===== The importand bits =====
- --- todo //[[fzenke@gmx.net|Friedemann Zenke]] 2014/01/10 20:08// 
  
  
-===== The full program ===== 
 <code c++> <code c++>
-/ +PoissonGroup poisson = new PoissonGroup(N,1.); 
-* Copyright 2014 Friedemann Zenke +PoissonGroup poisson2 = new PoissonGroup(N,1.); 
-+IFGroup neuron = new IFGroup(1); 
-* This file is part of Auryna simulation package for plastic +</code> 
-* spiking neural networks+Sets up the two Poisson neurons (two groups containing a single Poisson cell each) and single integrate-and-fire cell from the [[manual:IFGroup]] type.
- +
-* Auryn is free software: you can redistribute it and/or modify +
-* it under the terms of the GNU General Public License as published by +
-* the Free Software Foundationeither version 3 of the License, or +
-* (at your optionany later version. +
- +
-* Auryn is distributed in the hope that it will be useful, +
-* but WITHOUT ANY WARRANTY; without even the implied warranty of +
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the +
-* GNU General Public License for more details. +
-*  +
-* You should have received copy of the GNU General Public License +
-* along with Auryn.  If not, see <http://www.gnu.org/licenses/>+
-*/+
  
-#include <iostream+<code cpp
-#include <iomanip+IdentityConnection * con = new IdentityConnection(poisson,neuron,w,GLUT); 
-#include <stdlib.h> +IdentityConnection * con2 = new IdentityConnection(poisson2,neuron,w,GABA); 
-#include <string>+</code
 +Creates two one-to-one connetions between the Poisson neurons and the integrate-and-fire cell.
  
-#include <boost/program_options.hpp+<code
-#include <boost/mpi/environment.hpp> +SpikeMonitor * smon = new SpikeMonitor( neuron, tmpstr.c_str() ); 
-#include <boost/mpi/communicator.hpp+</code
-#include <boost/mpi.hpp>+Sets up a [[manual:SpikeMonitor]] and tells it to record from  our ''neuron''. The output is written to a file that is specified by ''tmpstr''.
  
-#include "auryn_global.h" +<code> 
-#include "auryn_definitions.h" +VoltageMonitor * vmon = new VoltageMonitor( neuron, 0, tmpstr.c_str() ); 
-#include "System.h" +</code> 
-#include "Logger.h" +Creates a [[manual:VoltageMonitor]] that records the voltage to a different file which is again specified in ''tmpstr''Note that an equivalent alternative syntax would be to recorde voltages would be directly using a [[manual:StateMonitor]]The conductance monitors are set up in a similar way.
-#include "NeuronGroup.h" +
-#include "IFGroup.h" +
-#include "AIFGroup.h" +
-#include "PoissonGroup.h" +
-#include "SparseConnection.h" +
-#include "IdentityConnection.h" +
-#include "TripletConnection.h" +
-#include "TripletDecayConnection.h" +
-#include "WeightMonitor.h" +
-#include "WeightMatrixMonitor.h" +
-#include "PopulationRateMonitor.h" +
-#include "SpikeMonitor.h" +
-#include "VoltageMonitor.h" +
-#include "AmpaMonitor.h" +
-#include "GabaMonitor.h" +
-#include "NmdaMonitor.h" +
-#include "DelayedSpikeMonitor.h" +
-#include "RateChecker.h" +
-#include "FileInputGroup.h"+
  
-#define N 1 
  
-using namespace std; +<code c++> 
- +logger->msg("Running ...",PROGRESS); 
-namespace po = boost::program_options; +sys->run(10);
-namespace mpi = boost::mpi; +
- +
-int main(int ac, char* av[])  +
-+
- +
- int errcode = 0; +
- char strbuf [255]; +
- string outputfile = "out_epsp"; +
- string tmpstr; +
- AurynWeight w = 1.0; +
- +
- // BEGIN Global definitions +
- mpi::environment env(ac, av); +
- mpi::communicator world; +
- communicator = &world; +
- +
- sprintf(strbuf, "out_epsp.%d.log", world.rank()); +
- string logfile = strbuf; +
- logger = new Logger(logfile,world.rank(),PROGRESS,EVERYTHING); +
- +
- sys = new System(&world); +
- // END Global definitions +
-  +
- PoissonGroup * poisson = new PoissonGroup(N,1.); +
- PoissonGroup * poisson2 = new PoissonGroup(N,1.); +
- IFGroup * neuron = new IFGroup(1); +
- +
- IdentityConnection * con = new IdentityConnection(poisson,neuron,w,GLUT); +
- IdentityConnection * con2 = new IdentityConnection(poisson2,neuron,w,GABA); +
- +
- tmpstr = outputfile; +
- tmpstr += ".ras"; +
- SpikeMonitor * smon = new SpikeMonitor( neuron, tmpstr.c_str() ); +
- +
- tmpstr = outputfile; +
- tmpstr += ".mem"; +
- VoltageMonitor * vmon = new VoltageMonitor( neuron, 0, tmpstr.c_str() ); +
- +
- tmpstr = outputfile; +
- tmpstr += ".ampa"; +
- AmpaMonitor * amon = new AmpaMonitor( neuron, 0, tmpstr.c_str() ); +
- +
- tmpstr = outputfile; +
- tmpstr += ".gaba"; +
- GabaMonitor * gmon = new GabaMonitor( neuron, 0, tmpstr.c_str() ); +
- +
- tmpstr = outputfile; +
- tmpstr += ".nmda"; +
- NmdaMonitor * nmon = new NmdaMonitor( neuron, 0, tmpstr.c_str() ); +
- +
- logger->msg("Running ...",PROGRESS); +
- sys->run(10); +
- +
- logger->msg("Freeing ...",PROGRESS,true); +
- delete sys; +
- +
- if (errcode) +
- env.abort(errcode); +
- return errcode; +
-}+
 </code> </code>
 +This finally outputs a message ''Running...'' on the console and triggers the run for 10s. Note the call of the global variable sys of type [[manual:System]].
  
examples/sim_epsp.1389381015.txt.gz · Last modified: 2014/01/10 19:10 by zenke