IntegratorFunctions¶
Functions that integrate current value of input with previous value.
IntegratorFunction
AccumulatorIntegrator
SimpleIntegrator
AdaptiveIntegrator
DualAdaptiveIntegrator
DriftDiffusionIntegrator
OrnsteinUhlenbeckIntegrator
InteractiveActivationIntegrator
LeakyCompetingIntegrator
FitzHughNagumoIntegrator

class
psyneulink.core.components.functions.statefulfunctions.integratorfunctions.
AccumulatorIntegrator
(default_variable=None, rate=1.0, increment=0.0, noise=0.0, initializer=None, params=None, owner=None, prefs=None)¶ Accumulates at a constant rate, that is either linear or exponential, depending on
rate
.function
ignoresvariable
and returns:\[previous\_value \cdot rate + increment + noise\]so that, with each call to
function
, the accumulated value increases by:\[increment \cdot rate^{time\ step}.\]Thus, accumulation increases lineary in steps of
increment
ifrate
=1.0, and exponentially otherwise.Modulatory Parameters:
Parameters:  default_variable (number, list or array : default class_defaults.variable) – specifies a template for the value to be integrated; if it is a list or array, each element is independently integrated.
 rate (float, list or 1d array : default 1.0) – specifies the rate of decay; if it is a list or array, it must be the same length as
variable
(seerate
for additional details.  increment (float, list or 1d array : default 0.0) – specifies an amount to be added to
previous_value
in each call tofunction
; if it is a list or array, it must be the same length asvariable
(seeincrement
for details).  noise (float, Function, list or 1d array : default 0.0) – specifies random value added to
prevous_value
in each call tofunction
; if it is a list or array, it must be the same length asvariable
(seenoise
for additonal details).  initializer (float, list or 1d array : default 0.0) – specifies starting value(s) for integration. If it is a list or array, it must be the same length as
default_variable
(seeinitializer
for details).  params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
 owner (Component) – component to which to assign the Function.
 name (str : default see
name
) – specifies the name of the Function.  prefs (PreferenceSet or specification dict : default Function.classPreferences) – specifies the
PreferenceSet
for the Function (seeprefs
for details).

variable
¶ number or array – Ignored by the AccumulatorIntegrator function. Use
LeakyCompetingIntegrator
orAdaptiveIntegrator
for integrator functions that depend on both a prior value and a new value (variable).

rate
¶ float or 1d array – determines the rate of exponential decay of
previous_value
in each call tofunction
. If it is a float or has a single element, its value is applied to all the elements ofprevious_value
; if it is an array, each element is applied to the corresponding element ofprevious_value
. Serves as MULTIPLICATIVE_PARAM for modulation offunction
.

increment
¶ float, function, or 1d array – determines the amount added to
previous_value
in each call tofunction
. If it is a list or array, it must be the same length asvariable
and each element is added to the corresponding element ofprevious_value
(i.e., it is used for Hadamard addition). If it is a scalar or has a single element, its value is added to all the elements ofprevious_value
. Serves as ADDITIVE_PARAM for modulation offunction
.

noise
¶ float, Function or 1d array – random value added in each call to
function
(seenoise
for details).

initializer
¶ float or 1d array – determines the starting value(s) for integration (i.e., the value(s) to which
previous_value
is set (seeinitializer
for details).

previous_value
¶ 1d array : default class_defaults.variable – stores previous value to which
rate
andnoise
will be added.

name
¶ str – the name of the Function; if it is not specified in the name argument of the constructor, a default is assigned by FunctionRegistry (see Naming for conventions used for default and duplicate names).

prefs
¶ PreferenceSet or specification dict : Function.classPreferences – the
PreferenceSet
for function; if it is not specified in the prefs argument of the Function’s constructor, a default is assigned usingclassPreferences
defined in __init__.py (see PreferenceSet for details).

function
(variable=None, execution_id=None, params=None, context=None)¶ Parameters: params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor. Returns: updated value of integral Return type: 2d array

class
psyneulink.core.components.functions.statefulfunctions.integratorfunctions.
SimpleIntegrator
(default_variable=None, rate=1.0, noise=0.0, offset=0.0, initializer=None, params=None, owner=None, prefs=None)¶ function
returns:\[previous_value + rate * variable + noise + offset\]Modulatory Parameters:
Parameters:  default_variable (number, list or array : default class_defaults.variable) – specifies a template for the value to be integrated; if it is a list or array, each element is independently integrated.
 rate (float, list or 1d array : default 1.0) – specifies the rate of integration; if it is a list or array, it must be the same length as
variable
(seerate
for details).  noise (float, function, list or 1d array : default 0.0) – specifies random value added to integral in each call to
function
; if it is a list or array, it must be the same length asvariable
(seenoise
for details).  offset (float, list or 1d array : default 0.0) – specifies constant value added to integral in each call to
function
; if it is a list or array, it must be the same length asvariable
(seeoffset
for details).  initializer (float, list or 1d array : default 0.0) – specifies starting value(s) for integration; if it is a list or array, it must be the same length as
default_variable
(seeinitializer
for details).  params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
 owner (Component) – component to which to assign the Function.
 name (str : default see
name
) – specifies the name of the Function.  prefs (PreferenceSet or specification dict : default Function.classPreferences) – specifies the
PreferenceSet
for the Function (seeprefs
for details).

variable
¶ number or array – current input value some portion of which (determined by
rate
) will be added to the prior value; if it is an array, each element is independently integrated.

rate
¶ float or 1d array – determines the rate of integration. If it is a float or has a single element, it is applied to all elements of
variable
; if it has more than one element, each element is applied to the corresponding element ofvariable
. Serves as MULTIPLICATIVE_PARAM for modulation offunction
.

noise
¶ float, Function or 1d array – random value added to integral in each call to
function
(seenoise
for details).

offset
¶ float or 1d array – constant value added to integral in each call to
function
. Ifvariable
is an array and offset is a float, offset is applied to each element of the integral; if offset is a list or array, each of its elements is applied to each of the corresponding elements of the integral (i.e., Hadamard addition). Serves as ADDITIVE_PARAM for modulation offunction
.

initializer
¶ float or 1d array – determines the starting value(s) for integration (i.e., the value to which
previous_value
is set (seeinitializer
for details).

previous_value
¶ 1d array : default class_defaults.variable – stores previous value with which
variable
is integrated.

name
¶ str – the name of the Function; if it is not specified in the name argument of the constructor, a default is assigned by FunctionRegistry (see Naming for conventions used for default and duplicate names).

prefs
¶ PreferenceSet or specification dict : Function.classPreferences – the
PreferenceSet
for function; if it is not specified in the prefs argument of the Function’s constructor, a default is assigned usingclassPreferences
defined in __init__.py (see PreferenceSet for details).

function
(variable=None, execution_id=None, params=None, context=None)¶ Parameters:  variable (number, list or array : default class_defaults.variable) – a single value or array of values to be integrated.
 params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
Returns: updated value of integral
Return type: 2d array

class
psyneulink.core.components.functions.statefulfunctions.integratorfunctions.
AdaptiveIntegrator
(default_variable=None, rate=1.0, noise=0.0, offset=0.0, initializer=None, params=None, owner=None, prefs=None)¶ function
returns exponentially weighted moving average (EWMA) of input:\[((1rate) * previous_value) + (rate * variable) + noise + offset\]Modulatory Parameters:
Parameters:  default_variable (number, list or array : default class_defaults.variable) – specifies a template for the value to be integrated; if it is a list or array, each element is independently integrated.
 rate (float, list or 1d array : default 1.0) – specifies the smoothing factor of the EWMA. If it is a list or array, it must be the
same length as
variable
(seerate
for details).  noise (float, function, list or 1d array : default 0.0) – specifies random value added to integral in each call to
function
; if it is a list or array, it must be the same length asvariable
(seenoise
for details).  offset (float, list or 1d array : default 0.0) – specifies constant value added to integral in each call to
function
; if it is a list or array, it must be the same length asvariable
(seeoffset
for details).  initializer (float, list or 1d array : default 0.0) – specifies starting value(s) for integration. If it is a list or array, it must be the same length as
default_variable
(seeinitializer
for details).  params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
 owner (Component) – component to which to assign the Function.
 name (str : default see
name
) – specifies the name of the Function.  prefs (PreferenceSet or specification dict : default Function.classPreferences) – specifies the
PreferenceSet
for the Function (seeprefs
for details).

variable
¶ number or array – current input value some portion of which (determined by
rate
) will be added to the prior value; if it is an array, each element is independently integrated.

rate
¶ float or 1d array – determines the smoothing factor of the EWMA. All rate elements must be between 0 and 1 (rate = 0 –> no change,
variable
is ignored; rate = 1 –>previous_value
is ignored). If rate is a float or has a single element, its value is applied to all elements ofvariable
andprevious_value
; if it is an array, each element is applied to the corresponding element ofvariable
andprevious_value
). Serves as MULTIPLICATIVE_PARAM for modulation offunction
.

noise
¶ float, Function or 1d array – random value added to integral in each call to
function
(seenoise
for details).

offset
¶ float or 1d array – constant value added to integral in each call to
function
. Ifvariable
is a list or array and offset is a float, offset is applied to each element of the integral; if offset is a list or array, each of its elements is applied to each of the corresponding elements of the integral (i.e., Hadamard addition). Serves as ADDITIVE_PARAM for modulation offunction
.

initializer
¶ float or 1d array – determines the starting value(s) for integration (i.e., the value(s) to which
previous_value
is set (seeinitializer
for details).

previous_value
¶ 1d array : default class_defaults.variable – stores previous value with which
variable
is integrated.

name
¶ str – the name of the Function; if it is not specified in the name argument of the constructor, a default is assigned by FunctionRegistry (see Naming for conventions used for default and duplicate names).

prefs
¶ PreferenceSet or specification dict : Function.classPreferences – the
PreferenceSet
for function; if it is not specified in the prefs argument of the Function’s constructor, a default is assigned usingclassPreferences
defined in __init__.py (see PreferenceSet for details).

function
(variable=None, execution_id=None, params=None, context=None)¶ Parameters:  variable (number, list or array : default class_defaults.variable) – a single value or array of values to be integrated.
 params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
Returns: updated value of integral
Return type: 2d array

class
psyneulink.core.components.functions.statefulfunctions.integratorfunctions.
DualAdaptiveIntegrator
(default_variable=None, initializer=None, initial_short_term_avg=0.0, initial_long_term_avg=0.0, short_term_gain=1.0, long_term_gain=1.0, short_term_bias=0.0, long_term_bias=0.0, short_term_rate=1.0, long_term_rate=1.0, operation=PRODUCT, offset=0.0, params=None, owner=None, prefs=None)¶ Combines two exponentially weighted moving averages (EWMA) of its input, each with a different rate, as implemented in AstonJones & Cohen (2005) to integrate utility over two time scales.
function
computes the EWMA ofvariable
using two integration rates (short_term_rate
and `long_term_rate <DualAdaptiveIntegrator.long_term_rate>), transforms each using a logistic function, and then combines them, as follows:short time scale integral:
\[short\_term\_avg = short\_term\_rate \cdot variable + (1  short\_term\_rate) \cdot previous\_short\_term\_avg\]long time scale integral:
\[long\_term\_avg = long\_term\_rate \cdot variable + (1  long\_term\_rate) \cdot previous\_long\_term\_avg\]
combined integral:
\[value = operation(1\frac{1}{1+e^{short\_term\_gain\ \cdot\ short\_term\_avg\ +\ short\_term\_bias}},\ \frac{1}{1+e^{long\_term\_gain\ \cdot\ long\_term\_avg + long\_term\_bias}})\ +\ offset\]where operation is the arithmetic
operation
used to combine the terms.
Modulatory Parameters:
ADDITIVE_PARAM:offset
Parameters:  initial_short_term_avg (float : default 0.0) – specifies starting value for integration of short_term_avg
 initial_long_term_avg (float : default 0.0) – specifies starting value for integration of long_term_avg
 short_term_gain (float : default 1.0) – specifies gain for logistic function applied to short_term_avg
 long_term_gain (float : default 1.0) – specifies gain for logistic function applied to long_term_avg
 short_term_bias (float : default 0.0) – specifies bias for logistic function applied to short_term_avg
 long_term_bias (float : default 0.0) – specifies bias for logistic function applied to long_term_avg
 short_term_rate (float : default 1.0) – specifies smoothing factor of EWMA filter applied to short_term_avg
 long_term_rate (float : default 1.0) – specifies smoothing factor of EWMA filter applied to long_term_avg
 operation (PRODUCT, SUM, S_MINUS_L or L_MINUS_S : default PRODUCT) – specifies the arithmetic operation used to combine the logistics of the short_term_avg and long_term_avg
(see
operation
for details).  offset (float or 1d array) – constant value added to integral in each call to
function
after logistics of short_term_avg and long_term_avg are combined; if it is a list or array, it must be the same length asvariable
(seeoffset
for details.  params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
 owner (Component) – component to which to assign the Function.
 name (str : default see
name
) – specifies the name of the Function.  prefs (PreferenceSet or specification dict : default Function.classPreferences) – specifies the
PreferenceSet
for the Function (seeprefs
for details).

variable
¶ number or array – current input value used to compute both the short term and long term EWMA averages.

initial_short_term_avg
¶ float – determines starting value for integration of short_term_avg

initial_long_term_avg
¶ float – determines starting value for integration of long_term_avg

short_term_gain
¶ float – determines gain for logistic function applied to short_term_avg

long_term_gain
¶ float – determines gain for logistic function applied to long_term_avg

short_term_bias
¶ float – determines bias for logistic function applied to short_term_avg

long_term_bias
¶ float – determines bias for logistic function applied to long_term_avg

operation
¶ str – determines the arithmetic operation used to combine short_term_logistic and long_term_logistic:
 PRODUCT = (1  short_term_logistic) * long_term_logistic
 SUM = (1  short_term_logistic) + long_term_logistic
 S_MINUS_L = (1  short_term_logistic)  long_term_logistic
 L_MINUS_S = long_term_logistic  (1  short_term_logistic)

offset
¶ float or 1d array – constant value added to integral in each call to
function
after logistics of short_term_avg and long_term_avg are combined. Ifvariable
is an array and offset is a float, offset is applied to each element of the integral; if offset is a list or array, each of its elements is applied to each of the corresponding elements of the integral (i.e., Hadamard addition). Serves as ADDITIVE_PARAM for modulation offunction
.

previous_short_term_avg
¶ 1d array – stores previous value with which
variable
is integrated using the EWMA filter and short term parameters

previous_long_term_avg
¶ 1d array – stores previous value with which
variable
is integrated using the EWMA filter and long term parameters

name
¶ str – the name of the Function; if it is not specified in the name argument of the constructor, a default is assigned by FunctionRegistry (see Naming for conventions used for default and duplicate names).

prefs
¶ PreferenceSet or specification dict : Function.classPreferences – the
PreferenceSet
for function; if it is not specified in the prefs argument of the Function’s constructor, a default is assigned usingclassPreferences
defined in __init__.py (see PreferenceSet for details).

function
(variable=None, execution_id=None, params=None, context=None)¶ Parameters:  variable (number, list or array : default class_defaults.variable) – a single value or array of values to be integrated.
 params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
Returns: updated value of integral
Return type: 2d array

reinitialize
(short=None, long=None, execution_context=None)¶ Effectively begins accumulation over again at the specified utilities.
Sets
previous_short_term_avg
to the quantity specified in the first argument andprevious_long_term_avg
to the quantity specified in the second argument.Sets
value
by computing it based on the newly updated values forprevious_short_term_avg
andprevious_long_term_avg
.If no arguments are specified, then the current values of
initial_short_term_avg
andinitial_long_term_avg
are used.

class
psyneulink.core.components.functions.statefulfunctions.integratorfunctions.
InteractiveActivationIntegrator
(default_variable=None, rate=1.0, decay=1.0, rest=0.0, max_val=1.0, min_val=1.0, noise=0.0, initializer=None, params=None, owner=None, prefs=None)¶ Implements a generalized version of the interactive activation from McClelland and Rumelhart (1981) that integrates current value of
variable
toward an asymptotic maximum valuemax_val
for positive inputs and toward an asymptotic mininum value (min_val
) for negative inputs, and decays asymptotically towards an intermediate resting value (rest
).function
returns:\[previous\_value + (rate * (variable + noise) * distance\_from\_asymptote)  (decay * distance\_from\_rest)\]where:
\[if\ variable > 0,\ distance\_from\_asymptote = max\_val  previous\_value\]\[if\ variable < 0,\ distance\_from\_asymptote = previous\_value  min\_val\]\[if\ variable = 0,\ distance\_from\_asymptote = 0\]Parameters:  default_variable (number, list or array : default class_defaults.variable) – specifies a template for the value to be integrated; if it is a list or array, each element is independently integrated.
 rate (float, list or 1d array : default 1.0) – specifies the rate of change in activity; its value(s) must be in the interval [0,1]. If it is a list or
array, it must be the same length as
variable
.  decay (float, list or 1d array : default 1.0) – specifies the rate of at which activity decays toward
rest
. If it is a list or array, it must be the same length asvariable
; its value(s) must be in the interval [0,1].  rest (float, list or 1d array : default 0.0) – specifies the initial value and one toward which value
decays
. If it is a list or array, it must be the same length asvariable
.  max_val (float, list or 1d array : default 1.0) – specifies the maximum asymptotic value toward which integration occurs for positive values of
variable
. If it is a list or array, it must be the same length asvariable
; all values must be greater than the corresponding values ofmin_val
(seemax_val
for details).  min_val (float, list or 1d array : default 1.0) – specifies the minimum asymptotic value toward which integration occurs for negative values of
variable
. If it is a list or array, it must be the same length asvariable
; all values must be greater than the corresponding values ofmax_val
(seemax_val
for details).  noise (float, function, list or 1d array : default 0.0) – specifies random value added to
variable
in each call tofunction
; if it is a list or array, it must be the same length asvariable
(seenoise
for details).  initializer (float, list or 1d array : default 0.0) – specifies starting value(s) for integration. If it is a list or array, it must be the same length as
default_variable
(seeinitializer
for details).  params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
 owner (Component) – component to which to assign the Function.
 name (str : default see
name
) – specifies the name of the Function.  prefs (PreferenceSet or specification dict : default Function.classPreferences) – specifies the
PreferenceSet
for the Function (seeprefs
for details).

variable
¶ number or array – current input value some portion of which (determined by
rate
) will be added to the prior value; if it is an array, each element is independently integrated.

rate
¶ float or 1d array in interval [0,1] – determines the rate at which activity increments toward either
max_val
(variable
is positive) ormin_val
(ifvariable
is negative). If it is a float or has a single element, it is applied to all elements ofvariable
; if it has more than one element, each element is applied to the corresponding element ofvariable
. Serves as MULTIPLICATIVE_PARAM for modulation offunction
.

decay
¶ float or 1d array – determines the rate of at which activity decays toward
rest
(similary to rate in other IntegratorFuncgtions). If it is a float or has a single element, it applies to all elements ofvariable
; if it has more than one element, each element applies to the corresponding element ofvariable
.

rest
¶ float or 1d array – determines the initial value and one toward which value
decays
(similar to bias in other IntegratorFunctions). If it is a float or has a single element, it applies to all elements ofvariable
; if it has more than one element, each element applies to the corresponding element ofvariable
.

max_val
¶ float or 1d array – determines the maximum asymptotic value toward which integration occurs for positive values of
variable
. If it is a float or has a single element, it applies to all elements ofvariable
; if it has more than one element, each element applies to the corresponding element ofvariable
.

min_val
¶ float or 1d array – determines the minimum asymptotic value toward which integration occurs for negative values of
variable
. If it is a float or has a single element, it applies to all elements ofvariable
; if it has more than one element, each element applies to the corresponding element ofvariable
.

noise
¶ float, Function or 1d array – random value added to
variable
in each call tofunction
(seenoise
for details).

initializer
¶ float or 1d array – determines the starting value(s) for integration (i.e., the value(s) to which
previous_value
is set (seeinitializer
for details).

previous_value
¶ 1d array : default class_defaults.variable – stores previous value with which
variable
is integrated.

name
¶ str – the name of the Function; if it is not specified in the name argument of the constructor, a default is assigned by FunctionRegistry (see Naming for conventions used for default and duplicate names).

prefs
¶ PreferenceSet or specification dict : Function.classPreferences – the
PreferenceSet
for function; if it is not specified in the prefs argument of the Function’s constructor, a default is assigned usingclassPreferences
defined in __init__.py (see PreferenceSet for details).

function
(variable=None, execution_id=None, params=None, context=None)¶ Parameters:  variable (number, list or array : default class_defaults.variable) – a single value or array of values to be integrated.
 params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
Returns: updated value of integral
Return type: 2d array

class
psyneulink.core.components.functions.statefulfunctions.integratorfunctions.
DriftDiffusionIntegrator
(default_variable=None, rate=1.0, noise=0.0, offset= 0.0, starting_point=0.0, threshold=1.0 time_step_size=1.0, initializer=None, params=None, owner=None, prefs=None)¶ Accumulate “evidence” to a bound.
function
returns one time step of integration:\[previous\_value + rate \cdot variable \cdot time\_step\_size + \mathcal{N}(\sigma^2)\]where
\[\sigma^2 =\sqrt{time\_step\_size \cdot noise}\]Modulatory Parameters:
Parameters:  default_variable (number, list or array : default class_defaults.variable) – specifies the stimulus component of drift rate – the drift rate is the product of variable and rate
 rate (float, list or 1d array : default 1.0) – applied multiplicatively to
variable
; If it is a list or array, it must be the same length asvariable
(seerate
for details).  noise (float : default 0.0) – specifies a value by which to scale the normally distributed random value added to the integral in each call to
function
(seenoise
for details).  offset (float, list or 1d array : default 0.0) – specifies constant value added to integral in each call to
function
if it’s absolute value is belowthreshold
; if it is a list or array, it must be the same length asvariable
(seeoffset
for details).  starting_point (float, list or 1d array: default 0.0) – determspecifies ines the starting value for the integration process; if it is a list or array, it must be the
same length as
variable
(seestarting_point
for details).  threshold (float : default 0.0) – specifies the threshold (boundaries) of the drift diffusion process – i.e., at which the
integration process terminates (see
threshold
for details).  time_step_size (float : default 0.0) – specifies the timing precision of the integration process (see
time_step_size
for details.  initializer (float, list or 1d array : default 0.0) – specifies starting value(s) for integration. If it is a list or array, it must be the same length as
default_variable
(seeinitializer
for details).  params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
 owner (Component) – component to which to assign the Function.
 name (str : default see
name
) – specifies the name of the Function.  prefs (PreferenceSet or specification dict : default Function.classPreferences) – specifies the
PreferenceSet
for the Function (seeprefs
for details).

variable
¶ float or array – current input value (can be thought of as implementing the stimulus component of the drift rate); if it is an array, each element represents an independently integrated decision variable.

rate
¶ float or 1d array – applied multiplicatively to
variable
(can be thought of as implementing the attentional component of the drift rate). If it is a float or has a single element, its value is applied to all the elements ofvariable
; if it is an array, each element is applied to the corresponding element ofvariable
. Serves as MULTIPLICATIVE_PARAM for modulation offunction
.

noise
¶ float – scales the normally distributed random value added to integral in each call to
function
. A single random term is generated each execution, and applied to all elements ofvariable
if that is an array with more than one element.

offset
¶ float or 1d array – constant value added to integral in each call to
function
if it’s absolute value is belowthreshold
. Ifvariable
is an array and offset is a float, offset is applied to each element of the integral; if offset is a list or array, each of its elements is applied to each of the corresponding elements of the integral (i.e., Hadamard addition). Serves as ADDITIVE_PARAM for modulation offunction
.

starting_point
¶ float or 1d array – determines the start the starting value for the integration process; if it is a list or array, it must be the same length as
variable
. Ifvariable
is an array and starting_point is a float, starting_point is used for each element of the integral; if starting_point is a list or array, each of its elements is used as the starting point for each element of the integral.

threshold
¶ float – determines the boundaries of the drift diffusion process: the integration process can be scheduled to terminate when the result of
function
equals or exceeds either the positive or negative value of threshold (see hint).Hint
For a Mechanism to terminate execution when the DriftDiffusionIntegrator reaches its threshold, the
function
, the Mechanisms to which it assigned must belong to a System or Composition with a Scheduler that applies theWhenFinished
Condition to that Mechanism.

time_step_size
¶ float – determines the timing precision of the integration process and is used to scale the
noise
parameter according to the standard DDM probability distribution.

initializer
¶ float or 1d array – determines the starting value(s) for integration (i.e., the value(s) to which
previous_value
is set (seeinitializer
for details).

previous_time
¶ float – stores previous time at which the function was executed and accumulates with each execution according to
time_step_size
.

previous_value
¶ 1d array : default class_defaults.variable – stores previous value with which
variable
is integrated.

name
¶ str – the name of the Function; if it is not specified in the name argument of the constructor, a default is assigned by FunctionRegistry (see Naming for conventions used for default and duplicate names).

prefs
¶ PreferenceSet or specification dict : Function.classPreferences – the
PreferenceSet
for function; if it is not specified in the prefs argument of the Function’s constructor, a default is assigned usingclassPreferences
defined in __init__.py (see PreferenceSet for details).

function
(variable=None, execution_id=None, params=None, context=None)¶ Parameters:  variable (number, list or array : default class_defaults.variable) – a single value or array of values to be integrated (can be thought of as the stimulus component of the drift rate).
 params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
Returns: updated value of integral
Return type: 2d array

class
psyneulink.core.components.functions.statefulfunctions.integratorfunctions.
OrnsteinUhlenbeckIntegrator
(default_variable=None, rate=1.0, decay=1.0, noise=0.0, offset= 0.0, starting_point=0.0, time_step_size=1.0, initializer=0.0, params=None, owner=None, prefs=None)¶ function
returns one time step of integration according to an Ornstein Uhlenbeck process:\[previous\_value + (decay \cdot previous\_value)  (rate \cdot variable) + \mathcal{N}(\sigma^2)\]where .. math:
\sigma^2 =\sqrt{time\_step\_size \cdot noise}
Modulatory Parameters:
Parameters:  default_variable (number, list or array : default class_defaults.variable) – specifies a template for the stimulus component of drift rate – the drift rate is the product of variable and rate
 rate (float, list or 1d array : default 1.0) – specifies value applied multiplicatively to
variable
; If it is a list or array, it must be the same length asvariable
(seerate
for details).  decay (float, list or 1d array : default 1.0) – specifies value applied multiplicatively to
previous_value
; If it is a list or array, it must be the same length asvariable
( seedecay
for details).  noise (float : default 0.0) – specifies a value by which to scale the normally distributed random value added to the integral in each call to
function
(seenoise
for details).  offset (float, list or 1d array : default 0.0) – specifies a constant value added to integral in each call to
function
; if it is a list or array, it must be the same length asvariable
(seeoffset
for details)  starting_point (float : default 0.0) – specifies the starting time of the model and is used to compute
previous_time
 time_step_size (float : default 0.0) – determines the timing precision of the integration process (see
time_step_size
for details.  initializer (float, list or 1d array : default 0.0) – specifies starting value(s) for integration. If it is a list or array, it must be the same length as
default_variable
(seeinitializer
for details).  params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
 owner (Component) – component to which to assign the Function.
 name (str : default see
name
) – specifies the name of the Function.  prefs (PreferenceSet or specification dict : default Function.classPreferences) – specifies the
PreferenceSet
for the Function (seeprefs
for details).

variable
¶ number or array – represents the stimulus component of drift. The product of
variable
andrate
is multiplied bytime_step_size
to model the accumulation of evidence during one step.

rate
¶ float or 1d array – applied multiplicatively to
variable
. If it is a float or has a single element, its value is applied to all the elements ofvariable
; if it is an array, each element is applied to the corresponding element ofvariable
. Serves as MULTIPLICATIVE_PARAM for modulation offunction
.

decay
¶ float or 1d array – applied multiplicatively to
previous_value
; If it is a float or has a single element, its value is applied to all the elements ofprevious_value
; if it is an array, each element is applied to the corresponding element ofprevious_value
.

noise
¶ float – scales the normally distributed random value added to integral in each call to
function
. A single random term is generated each execution, and applied to all elements ofvariable
if that is an array with more than one element.

offset
¶ float or 1d array – constant value added to integral in each call to
function
. Ifvariable
is an array and offset is a float, offset is applied to each element of the integral; if offset is a list or array, each of its elements is applied to each of the corresponding elements of the integral (i.e., Hadamard addition). Serves as ADDITIVE_PARAM for modulation offunction
.

starting_point
¶ float – determines the start time of the integration process.

time_step_size
¶ float – determines the timing precision of the integration process and is used to scale the
noise
parameter appropriately.

initializer
¶ float or 1d array – determines the starting value(s) for integration (i.e., the value(s) to which
previous_value
is set (seeinitializer
for details).

previous_value
¶ 1d array : default class_defaults.variable – stores previous value with which
variable
is integrated.

previous_time
¶ float – stores previous time at which the function was executed and accumulates with each execution according to
time_step_size
.

name
¶ str – the name of the Function; if it is not specified in the name argument of the constructor, a default is assigned by FunctionRegistry (see Naming for conventions used for default and duplicate names).

prefs
¶ PreferenceSet or specification dict : Function.classPreferences – the
PreferenceSet
for function; if it is not specified in the prefs argument of the Function’s constructor, a default is assigned usingclassPreferences
defined in __init__.py (see PreferenceSet for details).

function
(variable=None, execution_id=None, params=None, context=None)¶ Parameters:  variable (number, list or array : default class_defaults.variable) – a single value or array of values to be integrated.
 params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
Returns: updated value of integral
Return type: 2d array

class
psyneulink.core.components.functions.statefulfunctions.integratorfunctions.
LeakyCompetingIntegrator
(default_variable=None, rate=1.0, noise=0.0, offset=None, time_step_size=0.1, initializer=0.0, params=None, owner=None, prefs=None)¶ Implements Leaky Competitive Accumulator (LCA) described in Usher & McClelland (2001).
function
returns:\[rate \cdot previous\_value + variable + noise \sqrt{time\_step\_size}\]Modulatory Parameters:
Parameters:  default_variable (number, list or array : default class_defaults.variable) – specifies a template for the value to be integrated; if it is a list or array, each element is independently integrated.
 rate (float, list or 1d array : default 1.0) – specifies the value used to scale the contribution of
previous_value
to the integral on each time step. If it is a list or array, it must be the same length asvariable
(seerate
for details).  noise (float, function, list or 1d array : default 0.0) – specifies random value added to integral in each call to
function
; if it is a list or array, it must be the same length asvariable
(seenoise
for additonal details).  offset (float, list or 1d array : default 0.0) – specifies a constant value added to integral in each call to
function
; if it is a list or array, it must be the same length asvariable
(seeoffset
for details).  time_step_size (float : default 0.0) – determines the timing precision of the integration process (see
time_step_size
for details.  initializer (float, list or 1d array : default 0.0) – specifies starting value(s) for integration. If it is a list or array, it must be the same length as
default_variable
(seeinitializer
for details).  params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
 owner (Component) – component to which to assign the Function.
 name (str : default see
name
) – specifies the name of the Function.  prefs (PreferenceSet or specification dict : default Function.classPreferences) – specifies the
PreferenceSet
for the Function (seeprefs
for details).

variable
¶ number or array – current input value some portion of which (determined by
rate
) will be added to the prior value; if it is an array, each element is independently integrated.

rate
¶ float or 1d array – scales the contribution of
previous_value
to the accumulation of thevalue
on each time step. If it is a float or has a single element, its value is applied to all the elements ofprevious_value
; if it is an array, each element is applied to the corresponding element ofprevious_value
. Serves as MULTIPLICATIVE_PARAM for modulation offunction
.

noise
¶ float, Function, or 1d array – random value added to integral in each call to
function
. (seenoise
for details).

offset
¶ float or 1d array – constant value added to integral in each call to
function
. Ifvariable
is an array and offset is a float, offset is applied to each element of the integral; if offset is a list or array, each of its elements is applied to each of the corresponding elements of the integral (i.e., Hadamard addition). Serves as ADDITIVE_PARAM for modulation offunction
.

time_step_size
¶ float – determines the timing precision of the integration process and is used to scale the
noise
parameter appropriately.

initializer
¶ float or 1d array – determines the starting value(s) for integration (i.e., the value(s) to which
previous_value
is set (seeinitializer
for details).

previous_value
¶ 1d array : default class_defaults.variable – stores previous value with which
variable
is integrated.

name
¶ str – the name of the Function; if it is not specified in the name argument of the constructor, a default is assigned by FunctionRegistry (see Naming for conventions used for default and duplicate names).

prefs
¶ PreferenceSet or specification dict : Function.classPreferences – the
PreferenceSet
for function; if it is not specified in the prefs argument of the Function’s constructor, a default is assigned usingclassPreferences
defined in __init__.py (see PreferenceSet for details).

function
(variable=None, execution_id=None, params=None, context=None)¶ Parameters:  variable (number, list or array : default class_defaults.variable) – a single value or array of values to be integrated.
 params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
Returns: updated value of integral
Return type: 2d array

class
psyneulink.core.components.functions.statefulfunctions.integratorfunctions.
FitzHughNagumoIntegrator
(default_variable=1.0, initial_w=0.0, initial_v=0.0, time_step_size=0.05, t_0=0.0, a_v=1/3, b_v=0.0, c_v=1.0, d_v=0.0, e_v=1.0, f_v=1.0, threshold=1.0 time_constant_v=1.0, a_w=1.0, b_w=0.8, c_w=0.7, mode=1.0, uncorrelated_activity=0.0 time_constant_w = 12.5, integration_method="RK4" params=None, owner=None, prefs=None)¶ function
returns one time step of integration of the `FitzhughNagumo model https://en.wikipedia.org/wiki/FitzHugh–Nagumo_model>`_ of an excitable oscillator:\[time\_constant_v \frac{dv}{dt} = a_v * v^3 + (1 + threshold) * b_v * v^2 + ( threshold) * c_v * v^2 + d_v + e_v * w + f_v * I_{ext}\]where .. math:
time\_constant_w * \frac{dw}{dt} =` mode * a_w * v + b_w * w +c_w + (1  mode) * uncorrelated\_activity
Either Euler or Dormand–Prince (4th Order RungeKutta) methods of numerical integration can be used.
The FitzHughNagumoIntegrator implements all of the parameters of the FitzHughNagumo model; however, not all combinations of these are sensible. Typically, they are combined into two sets. These are described below, followed by a describption of how they are used to implement three common variants of the model with the FitzHughNagumoIntegrator.
Fast, Excitatory Variable:
\[\frac{dv}{dt} = \frac{a_v v^{3} + b_v v^{2} (1+threshold)  c_v v\, threshold + d_v + e_v\, previous_w + f_v\, variable)}{time\, constant_v}\]Slow, Inactivating Variable:
\[\frac{dw}{dt} = \frac{a_w\, mode\, previous_v + b_w w + c_w + uncorrelated\,activity\,(1mode)}{time\, constant_w}\]FitzhughNagumo Model
Fast, Excitatory Variable:
\[\frac{dv}{dt} = v  \frac{v^3}{3}  w + I_{ext}\]Slow, Inactivating Variable:
\[\frac{dw}{dt} = \frac{v + a  bw}{T}\]\(\frac{dw}{dt}\) often has the following parameter values:
\[\frac{dw}{dt} = 0.08\,(v + 0.7  0.8 w)\]Implementation in FitzHughNagumoIntegrator
The default values implement the above equations.
Modified FitzHughNagumo Model
Fast, Excitatory Variable:
\[\frac{dv}{dt} = v(av)(v1)  w + I_{ext}\]Slow, Inactivating Variable:
\[\frac{dw}{dt} = bv  cw\]Mahbub Khan (2013) provides a nice summary of why this formulation is useful.
Implementation in FitzHughNagumoIntegrator
The following parameter values must be specified in the equation for \(\frac{dv}{dt}\):
When the parameters above are set to the listed values, the FitzHughNagumoIntegrator equation for \(\frac{dv}{dt}\) reduces to the Modified FitzHughNagumo formulation, and the remaining parameters in the \(\frac{dv}{dt}\) equation correspond as follows:
Te following parameter values must be set in the equation for \(\frac{dw}{dt}\):
+—————————+—–+——+ —————+———————–+ FitzHughNagumoIntegrator Parameter c_w  mode  time_constant_w  uncorrelated_activity  +—————————+—–+——+ —————+———————–+ Value  0.0  1.0  1.0  0.0  +—————————+—–+——+ —————+———————–+
When the parameters above are set to the listed values, the FitzHughNagumoIntegrator equation for \(\frac{dw}{dt}\) reduces to the Modified FitzHughNagumo formulation, and the remaining parameters in the \(\frac{dw}{dt}\) equation correspond as follows:
Modified FitzHughNagumo Model as implemented in Gilzenrat (2002)
Fast, Excitatory Variable:
[Eq. (6) in Gilzenrat (2002) ]
\[\tau_v \frac{dv}{dt} = v(av)(v1)  u + w_{vX_1}\, f(X_1)\]Slow, Inactivating Variable:
[Eq. (7) & Eq. (8) in Gilzenrat (2002) ]
\[\tau_u \frac{du}{dt} = Cv + (1C)\, d  u\]Implementation in FitzHughNagumoIntegrator
The following FitzHughNagumoIntegrator parameter values must be set in the equation for \(\frac{dv}{dt}\):
When the parameters above are set to the listed values, the FitzHughNagumoIntegrator equation for \(\frac{dv}{dt}\) reduces to the Gilzenrat formulation, and the remaining parameters in the \(\frac{dv}{dt}\) equation correspond as follows:
The following FitzHughNagumoIntegrator parameter values must be set in the equation for \(\frac{dw}{dt}\):
When the parameters above are set to the listed values, the FitzHughNagumoIntegrator equation for \(\frac{dw}{dt}\) reduces to the Gilzenrat formulation, and the remaining parameters in the \(\frac{dw}{dt}\) equation correspond as follows:
Parameters:  default_variable (number, list or array : default class_defaults.variable) – specifies a template for the external stimulus
 initial_w (float, list or 1d array : default 0.0) – specifies starting value for integration of dw/dt. If it is a list or array, it must be the same length as
default_variable
 initial_v (float, list or 1d array : default 0.0) – specifies starting value for integration of dv/dt. If it is a list or array, it must be the same length as
default_variable
 time_step_size (float : default 0.1) – specifies the time step size of numerical integration
 t_0 (float : default 0.0) – specifies starting value for time
 a_v (float : default 1/3) – coefficient on the v^3 term of the dv/dt equation
 b_v (float : default 0.0) – coefficient on the v^2 term of the dv/dt equation
 c_v (float : default 1.0) – coefficient on the v term of the dv/dt equation
 d_v (float : default 0.0) – constant term in the dv/dt equation
 e_v (float : default 1.0) – coefficient on the w term in the dv/dt equation
 f_v (float : default 1.0) – coefficient on the external stimulus (
variable
) term in the dv/dt equation  time_constant_v (float : default 1.0) – scaling factor on the dv/dt equation
 a_w (float : default 1.0,) – coefficient on the v term of the dw/dt equation
 b_w (float : default 0.8,) – coefficient on the w term of the dv/dt equation
 c_w (float : default 0.7,) – constant term in the dw/dt equation
 threshold (float : default 1.0) – specifies a value of the input below which the LC will tend not to respond and above which it will
 mode (float : default 1.0) – coefficient which simulates electrotonic coupling by scaling the values of dw/dt such that the v term (representing the input from the LC) increases when the uncorrelated_activity term (representing baseline activity) decreases
 uncorrelated_activity (float : default 0.0) – constant term in the dw/dt equation
 time_constant_w (float : default 12.5) – scaling factor on the dv/dt equation
 integration_method (str : default "RK4") – selects the numerical integration method. Currently, the choices are: “RK4” (4th Order RungeKutta) or “EULER” (Forward Euler)
 params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
 owner (Component) – component to which to assign the Function.
 name (str : default see
name
) – specifies the name of the Function.  prefs (PreferenceSet or specification dict : default Function.classPreferences) – specifies the
PreferenceSet
for the Function (seeprefs
for details).

variable
¶ number or array – External stimulus

previous_v
¶ 1d array : default class_defaults.variable – stores accumulated value of v during integration

previous_w
¶ 1d array : default class_defaults.variable – stores accumulated value of w during integration

previous_t
¶ float – stores accumulated value of time, which is incremented by time_step_size on each execution of the function

initial_w
¶ float, list or 1d array : default 0.0 – specifies starting value for integration of dw/dt. If it is a list or array, it must be the same length as
default_variable

initial_v
¶ float, list or 1d array : default 0.0 – specifies starting value for integration of dv/dt. If it is a list or array, it must be the same length as
default_variable

time_step_size
¶ float : default 0.1 – specifies the time step size of numerical integration

t_0
¶ float : default 0.0 – specifies starting value for time

a_v
¶ float : default 1/3 – coefficient on the v^3 term of the dv/dt equation

b_v
¶ float : default 0.0 – coefficient on the v^2 term of the dv/dt equation

c_v
¶ float : default 1.0 – coefficient on the v term of the dv/dt equation

d_v
¶ float : default 0.0 – constant term in the dv/dt equation

e_v
¶ float : default 1.0 – coefficient on the w term in the dv/dt equation

f_v
¶ float : default 1.0 – coefficient on the external stimulus (
variable
) term in the dv/dt equation

time_constant_v
¶ float : default 1.0 – scaling factor on the dv/dt equation

a_w
¶ float : default 1.0 – coefficient on the v term of the dw/dt equation

b_w
¶ float : default 0.8 – coefficient on the w term of the dv/dt equation

c_w
¶ float : default 0.7 – constant term in the dw/dt equation

threshold
¶ float : default 1.0 – coefficient that scales both the v^2 [ (1+threshold)*v^2 ] and v [ (threshold)*v ] terms in the dv/dt equation under a specific formulation of the FitzHughNagumo equations, the threshold parameter behaves as a “threshold of excitation”, and has the following relationship with variable (the external stimulus):
 when the external stimulus is below the threshold of excitation, the system is either in a stable state, or will emit a single excitation spike, then reach a stable state. The behavior varies depending on the magnitude of the difference between the threshold and the stimulus.
 when the external stimulus is equal to or above the threshold of excitation, the system is unstable, and will emit many excitation spikes
 when the external stimulus is too far above the threshold of excitation, the system will emit some excitation spikes before reaching a stable state.

mode
¶ float : default 1.0 – coefficient which simulates electrotonic coupling by scaling the values of dw/dt such that the v term (representing the input from the LC) increases when the uncorrelated_activity term (representing baseline activity) decreases
float : default 0.0 – constant term in the dw/dt equation

time_constant_w
¶ float : default 12.5 – scaling factor on the dv/dt equation

prefs
¶ PreferenceSet or specification dict : default Function.classPreferences – the
PreferenceSet
for the Function (seeprefs
for details).

function
(variable=None, execution_id=None, params=None, context=None)¶ Parameters: params (Dict[param keyword: param value] : default None) – a parameter dictionary that specifies the parameters for the function. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor. Returns: current value of v , current value of w Return type: float, list, or array