NEST main@caf0ae8
 
Loading...
Searching...
No Matches
erfc_neuron.h
Go to the documentation of this file.
1/*
2 * erfc_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 ERFC_NEURON_H
24#define ERFC_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 complementary error function as
38activation function
39
40Description
41+++++++++++
42
43The ``erfc_neuron`` is an implementation of a binary neuron that
44is irregularly updated at Poisson time points. At each update
45point, the total synaptic input :math:`h` into the neuron is summed up,
46passed through a gain function :math:`g` whose output is interpreted as
47the probability of the neuron to be in the active (1) state.
48
49The gain function used here is
50
51.. math::
52
53 g(h) = \frac{1}{2} \mathrm{erfc} \frac{h - \theta}{\sqrt{2}\sigma}\;.
54
55This corresponds to a McCulloch-Pitts neuron receiving additional
56Gaussian noise with mean 0 and standard deviation :math:`\sigma`. The time
57constant :math:`\tau_m` is defined as the mean of the inter-update-interval
58that is drawn from an exponential distribution with this
59parameter. Using this neuron to reproduce simulations with
60asynchronous update (similar to :footcite:p:`Ginzburg1994` :footcite:p:`McCulloch1943`), the time constant needs to be
61chosen as :math:`\tau_m = dt \times N`, where :math:`dt` is the simulation
62time step and :math:`N` the number of neurons in the original simulation with asynchronous
63update. This ensures that a neuron is updated on average every :math:`\tau_m`
64ms. Since in the original papers :footcite:p:`Ginzburg1994` :footcite:p:`McCulloch1943` neurons are coupled with zero
65delay, this implementation follows that definition. It uses the update
66scheme described in :footcite:p:`Morrison2007b` to maintain causality: The incoming events in
67time step `t_i` are taken into account at the beginning of the time step
68to calculate the gain function and to decide upon a transition. In
69order to obtain delayed coupling with delay :math:`d`, the user has to specify
70the delay :math:`d+h` upon connection, where :math:`h` is the simulation time step.
71
72
73Parameters
74++++++++++
75
76====== ====== =========================================================
77 tau_m ms Membrane time constant (mean inter-update-interval)
78 theta mV threshold for sigmoidal activation function
79 sigma mV 1/sqrt(2pi) x inverse of maximal slope
80====== ====== =========================================================
81
82.. admonition:: Special requirements for binary neurons
83
84 As the ``erfc_neuron`` is a binary neuron, the user must
85 ensure that the following requirements are observed. NEST does not
86 enforce them. Breaching the requirements can lead to meaningless
87 results.
88
89 1. Binary neurons must only be connected to other binary neurons.
90
91 #. No more than one connection must be created between any pair of
92 binary neurons. When using probabilistic connection rules, specify
93 ``'allow_autapses': False`` to avoid accidental creation of
94 multiple connections between a pair of neurons.
95
96 #. Binary neurons can be driven by current-injecting devices, but
97 *not* by spike generators.
98
99 #. Activity of binary neurons can only be recored using a ``spin_detector``
100 or ``correlospinmatrix_detector``.
101
102
103References
104++++++++++
105
106.. footbibliography::
107
108Receives
109++++++++
110
111CurrentEvent
112
113See also
114++++++++
115
116Examples using this model
117+++++++++++++++++++++++++
118
119.. listexamples:: erfc_neuron
120
121
122EndUserDocs */
123
125{
126private:
128 double theta_;
129
131 double sigma_;
132
133public:
137 : theta_( 0.0 )
138 , sigma_( 1.0 )
139 {
140 }
141
142 void get( Dictionary& ) const;
143 void set( const Dictionary&, Node* node );
144
145 bool operator()( RngPtr rng, double h );
146};
147
148inline bool
150{
151 return rng->drand() < 0.5 * erfc( -( h - theta_ ) / ( sqrt( 2. ) * sigma_ ) );
152}
153
155void register_erfc_neuron( const std::string& name );
156
157
158template <>
160
161} // namespace nest
162
163
164#endif /* #ifndef ERFC_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 erfc_neuron.h:125
double theta_
threshold of activation function
Definition erfc_neuron.h:128
void set(const Dictionary &, Node *node)
Set values from dictionary.
Definition erfc_neuron.cpp:49
void get(Dictionary &) const
Store current values in dictionary.
Definition erfc_neuron.cpp:42
double sigma_
1/sqrt(2pi) x inverse of the maximal slope of gain function
Definition erfc_neuron.h:131
gainfunction_erfc()
sets default parameters
Definition erfc_neuron.h:136
bool operator()(RngPtr rng, double h)
Definition erfc_neuron.h:149
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
binary_neuron< gainfunction_erfc > erfc_neuron
Definition erfc_neuron.h:154
void register_erfc_neuron(const std::string &name)
Definition erfc_neuron.cpp:35