tutorials:tutorial_2
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| tutorials:tutorial_2 [2016/09/01 21:04] – created zenke | tutorials:tutorial_2 [2018/02/28 17:58] (current) – [Visualizing the spikes] Adds gnuplot code for spike raster zenke | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| Here you will learn to wire up a simple balanced network. | Here you will learn to wire up a simple balanced network. | ||
| This assumes that you already know the basics explained in [[Tutorial 1]]. | This assumes that you already know the basics explained in [[Tutorial 1]]. | ||
| + | |||
| + | The code of this example can be found here | ||
| + | https:// | ||
| + | |||
| ===== Setting up neural populations ===== | ===== Setting up neural populations ===== | ||
| Line 14: | Line 18: | ||
| IFGroup * neurons_exc = new IFGroup(nb_exc_neurons); | IFGroup * neurons_exc = new IFGroup(nb_exc_neurons); | ||
| neurons_exc-> | neurons_exc-> | ||
| + | neurons_exc-> | ||
| IFGroup * neurons_inh = new IFGroup(nb_inh_neurons); | IFGroup * neurons_inh = new IFGroup(nb_inh_neurons); | ||
| neurons_inh-> | neurons_inh-> | ||
| Line 19: | Line 24: | ||
| </ | </ | ||
| - | The above code snipped initializes an excitatory population ('' | + | The above code snipped initializes an excitatory population ('' |
| As before in [[Tutorial 1]] we define Poisson input as a separate population: | As before in [[Tutorial 1]] we define Poisson input as a separate population: | ||
| Line 28: | Line 33: | ||
| </ | </ | ||
| - | ==== Connecting the network ==== | + | ===== Connecting the network |
| Now let's connect these three populations. First the input: | Now let's connect these three populations. First the input: | ||
| Line 48: | Line 53: | ||
| Note that we made inhibitory connections stronger by a factor of '' | Note that we made inhibitory connections stronger by a factor of '' | ||
| - | ==== Set up monitors ==== | + | ===== Set up monitors |
| Let's record spikes from all neurons and the membrane potential from neuron 0 in the excitatory population. | Let's record spikes from all neurons and the membrane potential from neuron 0 in the excitatory population. | ||
| Line 60: | Line 65: | ||
| - | ==== Running the simulation ==== | + | ===== Running the simulation |
| To run the simulation for 10 seconds we simply add the run command: | To run the simulation for 10 seconds we simply add the run command: | ||
| Line 75: | Line 80: | ||
| - | ===== Visualizing the spikes ===== | + | ====== Visualizing the spikes |
| Running above code will generate the following files: | Running above code will generate the following files: | ||
| Line 86: | Line 91: | ||
| </ | </ | ||
| - | Let's take a look at the spikes (in the [[manual: | + | Let's take a look at the spikes (in the [[manual: |
| + | < | ||
| + | set xrange [2:5] | ||
| + | set yrange [:5000] | ||
| + | plot ' | ||
| + | </ | ||
| {{ : | {{ : | ||
| That's a lot of spikes, but the image suggests that there is some synchrony going on at times, but there are also phases of asynchronous firing. Let's zoom in a bit more: | That's a lot of spikes, but the image suggests that there is some synchrony going on at times, but there are also phases of asynchronous firing. Let's zoom in a bit more: | ||
| {{ : | {{ : | ||
| + | |||
| + | We can also analyze this a little more and plot for instance the distribution of firing rates: | ||
| + | {{ : | ||
| Now let's have a look the membrane trace we recorded from one of our cells: | Now let's have a look the membrane trace we recorded from one of our cells: | ||
| Line 95: | Line 109: | ||
| After some initial burn in period of the network dynamics the neuron seems to start firing more irregularly. | After some initial burn in period of the network dynamics the neuron seems to start firing more irregularly. | ||
| + | |||
| + | ===== Writing a cell assembly into the E-to-E connections ===== | ||
| + | |||
| + | Now for the fun of it, let's add a simple cell assembly to the network. Auryn support multiple ways of doing that, but the simples is to simply write a block into the weight matrix. Let's add the following code after our run instruction: | ||
| + | <code c++> | ||
| + | con_ee-> | ||
| + | sys-> | ||
| + | </ | ||
| + | which increases weights in a diagonal block in the E->E connections and then runs the simulation for another 2 seconds. | ||
| + | |||
| + | Plotting again reveals the effect of this change in the spiking activity: | ||
| + | {{ : | ||
| + | |||
| + | For more sophisticated ways of writing patterns or synfire chain structures into a connectivity matrix, check out the documentation of [[manual: | ||
| + | You can also always load a weight matrix from an external file which have generated using MATLAB or Python. Auryn supports a coordinate based [[http:// | ||
| + | |||
| + | |||
| + | In the next [[Tutorial 3|tutorial]] we will make this model plastic. | ||
| + | |||
| + | ====== Exercises ====== | ||
| + | |||
| + | * Run the same simulation in parallel | ||
| + | * Tune the connectivity parameters to asynchronous irregular firing at lower firing rates | ||
| + | * Add three cell assemblies and make them multi stable | ||
tutorials/tutorial_2.1472763896.txt.gz · Last modified: 2016/09/01 21:04 by zenke
