NEST main@caf0ae8
 
Loading...
Searching...
No Matches
ginzburg_neuron.h
Go to the documentation of this file.
1/*
2 * ginzburg_neuron.h
3 *
4 * This file is part of NEST.
5 *
6 * Copyright (C) 2004 The NEST Initiative
7 *
8 * NEST is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * NEST is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef GINZBURG_NEURON_H
24#define GINZBURG_NEURON_H
25
26// Includes from models:
27#include "binary_neuron.h"
28
29namespace nest
30{
31
32/* BeginUserDocs: neuron, binary
33
34Short description
35+++++++++++++++++
36
37Binary stochastic neuron with sigmoidal activation function
38
39Description
40+++++++++++
41
42The ``ginzburg_neuron`` is an implementation of a binary neuron that
43is irregularly updated as Poisson time points. At each update
44point, the total synaptic input h into the neuron is summed up,
45passed through a gain function g whose output is interpreted as
46the probability of the neuron to be in the active (1) state.
47
48The gain function used here is :math:`g(h) = c_1 h + c_2 (1 +
49\tanh(c_3 (h-\theta)))/2` (output clipped to :math:`[0, 1]`). This permits
50affine-linear (:math:`c_1\neq0, c_2\neq0, c_3=0`) or sigmoidally shaped
51(:math:`c_1=0, c_2=1, c_3\neq0`) gain functions. The latter choice
52corresponds to the definition in :footcite:p:`Ginzburg1994`, giving the name to this
53neuron model.
54
55The choice :math:`c_1=0, c_2=1, c_3=\beta/2` corresponds to the Glauber
56dynamics :footcite:p:`Hertz1991`, :math:`g(h) = 1 / (1 + \exp(-\beta (h-\theta)))`.
57The time constant :math:`\tau_m` is defined as the mean
58inter-update-interval that is drawn from an exponential
59distribution with this parameter. Using this neuron to reproduce
60simulations with asynchronous update :footcite:p:`Ginzburg1994`, the time constant needs
61to be chosen as :math:`\tau_m = dt \times N`, where :math:`dt` is the simulation time
62step and :math:`N` the number of neurons in the original simulation with
63asynchronous update. This ensures that a neuron is updated on
64average every :math:`\tau_m` ms. Since in the original paper :footcite:p:`Ginzburg1994` neurons
65are coupled with zero delay, this implementation follows this
66definition. It uses the update scheme described in :footcite:p:`Morrison2007b` to
67maintain causality: The incoming events in time step :math:`t_i` are
68taken into account at the beginning of the time step to calculate
69the gain function and to decide upon a transition. In order to
70obtain delayed coupling with delay :math:`d`, the user has to specify the
71delay :math:`d+h` upon connection, where :math:`h` is the simulation time step.
72
73
74Parameters
75++++++++++
76
77====== ============= ===========================================================
78tau_m ms Membrane time constant (mean inter-update-interval)
79theta mV Threshold for sigmoidal activation function
80c_1 probability/ Linear gain factor
81 mV
82c_2 probability Prefactor of sigmoidal gain
83c_3 1/mV Slope factor of sigmoidal gain
84====== ============= ===========================================================
85
86.. admonition:: Special requirements for binary neurons
87
88 As the ``ginzburg_neuron`` is a binary neuron, the user must
89 ensure that the following requirements are observed. NEST does not
90 enforce them. Breaching the requirements can lead to meaningless
91 results.
92
93 1. Binary neurons must only be connected to other binary neurons.
94
95 #. No more than connection must be created between any pair of
96 binary neurons. When using probabilistic connection rules, specify
97 ``'allow_autapses': False`` to avoid accidental creation of
98 multiple connections between a pair of neurons.
99
100 #. Binary neurons can be driven by current-injecting devices, but
101 *not* by spike generators.
102
103 #. Activity of binary neurons can only be recored using a ``spin_detector``
104 or ``correlospinmatrix_detector``.
105
106
107References
108++++++++++
109
110.. footbibliography::
111
112Receives
113++++++++
114
115CurrentEvent
116
117See also
118++++++++
119
120
121Examples using this model
122+++++++++++++++++++++++++
123
124.. listexamples:: ginzburg_neuron
125
126EndUserDocs */
127
129{
130private:
132 double theta_;
133
135 double c1_;
136
138 double c2_;
139
141 double c3_;
142
143public:
147 : theta_( 0.0 ) // mV
148 , c1_( 0.0 ) // (mV)^-1
149 , c2_( 1.0 ) // dimensionless
150 , c3_( 1.0 ) // (mV)^-1
151 {
152 }
153
154 void get( Dictionary& ) const;
155 void set( const Dictionary&, Node* node );
156
157 bool operator()( RngPtr rng, double h ) const;
158};
159
160inline bool
162{
163 return rng->drand() < c1_ * h + c2_ * 0.5 * ( 1.0 + tanh( c3_ * ( h - theta_ ) ) );
164}
165
167void register_ginzburg_neuron( const std::string& name );
168
169
170template <>
172
173} // namespace nest
174
175
176#endif /* #ifndef GINZBURG_NEURON_H */
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Base class for RNG engine wrappers.
Definition random_generators.h:67
virtual double drand()=0
Uses the wrapped RNG engine to draw a double from a uniform distribution in the range [0,...
Base class for all NEST network objects.
Definition node.h:99
void create()
Create the map.
Definition recordables_map.h:127
Binary stochastic neuron with linear or sigmoidal gain function.
Definition binary_neuron.h:76
Definition ginzburg_neuron.h:129
double c1_
linear gain factor of gain function
Definition ginzburg_neuron.h:135
void get(Dictionary &) const
Store current values in dictionary.
Definition ginzburg_neuron.cpp:42
double c3_
gain factor of sigmoidal gain function
Definition ginzburg_neuron.h:141
void set(const Dictionary &, Node *node)
Set values from dictionary.
Definition ginzburg_neuron.cpp:51
double c2_
prefactor of sigmoidal gain function
Definition ginzburg_neuron.h:138
double theta_
threshold of sigmoidal activation function
Definition ginzburg_neuron.h:132
gainfunction_ginzburg()
sets default parameters
Definition ginzburg_neuron.h:146
bool operator()(RngPtr rng, double h) const
Definition ginzburg_neuron.h:161
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
void register_ginzburg_neuron(const std::string &name)
Definition ginzburg_neuron.cpp:35
binary_neuron< gainfunction_ginzburg > ginzburg_neuron
Definition ginzburg_neuron.h:166