Skip to content

Commit d713087

Browse files
authored
Merge pull request nest#1573 from niltonlk/specify-rectify-rate
Add min_rate to specify a non-zero rectfying rate for rate neuron models with input noise (rate_neuron_ipn)
2 parents 38f8a55 + 47ab8a4 commit d713087

11 files changed

+30
-11
lines changed

models/gauss_rate.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ transformers.
8383
g real Gain parameter
8484
mu real Mean of the Gaussian gain function
8585
sigma real Standard deviation of Gaussian gain function
86+
rectify_rate real Rectfying rate
8687
linear_summation boolean Specifies type of non-linearity (see above)
87-
rectify_output boolean Switch to restrict rate to values >= 0
88+
rectify_output boolean Switch to restrict rate to values >= rectify_rate
8889
================= ======= ==============================================
8990
9091
Note:

models/lin_rate.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ transformers.
8585
g_in real Linear factor in multiplicative coupling
8686
theta_ex real Shift in multiplicative coupling
8787
theta_in real Shift in multiplicative coupling
88-
rectify_output boolean Switch to restrict rate to values >= 0
88+
rectify_rate real Rectfying rate
89+
rectify_output boolean Switch to restrict rate to values >= rectify_rate
8990
=============== ======= ==================================================
9091
9192

models/rate_neuron_ipn.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,18 @@ class rate_neuron_ipn : public Archiving_Node
178178
/** Mean input.*/
179179
double mu_;
180180

181+
/** Minimum rate.*/
182+
double rectify_rate_;
183+
181184
/** Target of non-linearity.
182185
True (default): Gain function applied to linearly summed input.
183186
False: Gain function applied to each input before summation.
184187
**/
185188
bool linear_summation_;
186189

187190
/** Should the rate be rectified?.
188-
True: If the rate is negative it is set to zero after each time step.
191+
True: If the rate is smaller than rectify_rate it is set to rectify_rate
192+
after each time step.
189193
False (default): No rectification.
190194
**/
191195
bool rectify_output_;

models/rate_neuron_ipn_impl.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ nest::rate_neuron_ipn< TNonlinearities >::Parameters_::Parameters_()
6868
, lambda_( 1.0 ) // ms
6969
, sigma_( 1.0 )
7070
, mu_( 0.0 )
71+
, rectify_rate_( 0.0 )
7172
, linear_summation_( true )
7273
, rectify_output_( false )
7374
, mult_coupling_( false )
@@ -94,6 +95,7 @@ nest::rate_neuron_ipn< TNonlinearities >::Parameters_::get( DictionaryDatum& d )
9495
def< double >( d, names::lambda, lambda_ );
9596
def< double >( d, names::sigma, sigma_ );
9697
def< double >( d, names::mu, mu_ );
98+
def< double >( d, names::rectify_rate, rectify_rate_ );
9799
def< bool >( d, names::linear_summation, linear_summation_ );
98100
def< bool >( d, names::rectify_output, rectify_output_ );
99101
def< bool >( d, names::mult_coupling, mult_coupling_ );
@@ -110,6 +112,7 @@ nest::rate_neuron_ipn< TNonlinearities >::Parameters_::set( const DictionaryDatu
110112
updateValueParam< double >( d, names::tau, tau_, node );
111113
updateValueParam< double >( d, names::lambda, lambda_, node );
112114
updateValueParam< double >( d, names::mu, mu_, node );
115+
updateValueParam< double >( d, names::rectify_rate, rectify_rate_, node );
113116
updateValueParam< double >( d, names::sigma, sigma_, node );
114117
updateValueParam< bool >( d, names::linear_summation, linear_summation_, node );
115118
updateValueParam< bool >( d, names::rectify_output, rectify_output_, node );
@@ -145,6 +148,10 @@ nest::rate_neuron_ipn< TNonlinearities >::Parameters_::set( const DictionaryDatu
145148
{
146149
throw BadProperty( "Noise parameter must not be negative." );
147150
}
151+
if ( rectify_rate_ < 0 )
152+
{
153+
throw BadProperty( "Rectifying rate must not be negative." );
154+
}
148155
}
149156

150157
template < class TNonlinearities >
@@ -339,9 +346,9 @@ nest::rate_neuron_ipn< TNonlinearities >::update_( Time const& origin,
339346
S_.rate_ += V_.P2_ * H_in * ( delayed_rates_in + instant_rates_in );
340347
}
341348

342-
if ( P_.rectify_output_ and S_.rate_ < 0 )
349+
if ( P_.rectify_output_ and S_.rate_ < P_.rectify_rate_ )
343350
{
344-
S_.rate_ = 0;
351+
S_.rate_ = P_.rectify_rate_;
345352
}
346353

347354
if ( called_from_wfr_update )

models/rate_neuron_opn_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ nest::rate_neuron_opn< TNonlinearities >::Parameters_::set( const DictionaryDatu
114114
if ( updateValueParam< double >( d, names::mean, mu_, node ) )
115115
{
116116
LOG( M_WARNING,
117-
"rate_neuron_ipn< TNonlinearities >::Parameters_::set",
117+
"rate_neuron_opn< TNonlinearities >::Parameters_::set",
118118
"The parameter mean has been renamed to mu. Please use the new "
119119
"name from now on." );
120120
}
121121

122122
if ( updateValueParam< double >( d, names::std, sigma_, node ) )
123123
{
124124
LOG( M_WARNING,
125-
"rate_neuron_ipn< TNonlinearities >::Parameters_::set",
125+
"rate_neuron_opn< TNonlinearities >::Parameters_::set",
126126
"The parameter std has been renamed to sigma. Please use the new "
127127
"name from now on." );
128128
}

models/sigmoid_rate.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ transformers.
8181
g real Gain parameter
8282
beta real Slope parameter
8383
theta real Threshold
84+
rectify_rate real Rectfying rate
8485
linear_summation boolean Specifies type of non-linearity (see above)
85-
rectify_output boolean Switch to restrict rate to values >= 0
86+
rectify_output boolean Switch to restrict rate to values >= rectify_rate
8687
================== ======= ==============================================
8788
8889
Note:

models/sigmoid_rate_gg_1998.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ transformers.
7575
mu real Mean input
7676
sigma real Noise parameter
7777
g real Gain parameter
78+
rectify_rate real Rectfying rate
7879
linear_summation boolean Specifies type of non-linearity (see above)
79-
rectify_output boolean Switch to restrict rate to values >= 0
80+
rectify_output boolean Switch to restrict rate to values >= rectify_rate
8081
================== ======= ==============================================
8182
8283

models/tanh_rate.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ transformers.
7575
sigma real Noise parameter
7676
g real Gain parameter
7777
theta real Threshold
78+
rectify_rate real Rectfying rate
7879
linear_summation boolean Specifies type of non-linearity (see above)
79-
rectify_output boolean Switch to restrict rate to values >= 0
80+
rectify_output boolean Switch to restrict rate to values >= rectify_rate
8081
================== ======= ==============================================
8182
8283
Note:

models/threshold_lin_rate.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ transformers.
8686
g real Gain parameter
8787
alpha real Second Threshold
8888
theta real Threshold
89+
rectify_rate real Rectfying rate
8990
linear_summation boolean Specifies type of non-linearity (see above)
90-
rectify_output boolean Switch to restrict rate to values >= 0
91+
rectify_output boolean Switch to restrict rate to values >= rectify_rate
9192
================== ======= ==============================================
9293
9394
References

nestkernel/nest_names.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ const Name recordables( "recordables" );
348348
const Name recorder( "recorder" );
349349
const Name recording_backends( "recording_backends" );
350350
const Name rectify_output( "rectify_output" );
351+
const Name rectify_rate( "rectify_rate" );
351352
const Name refractory_input( "refractory_input" );
352353
const Name registered( "registered" );
353354
const Name relative_amplitude( "relative_amplitude" );

nestkernel/nest_names.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ extern const Name recordables;
369369
extern const Name recorder;
370370
extern const Name recording_backends;
371371
extern const Name rectify_output;
372+
extern const Name rectify_rate;
372373
extern const Name refractory_input;
373374
extern const Name registered;
374375
extern const Name relative_amplitude;

0 commit comments

Comments
 (0)