# GatingProjection¶

## Overview¶

A GatingProjection is a type of ModulatoryProjection that projects to the InputState or OutputState of a Mechanism. It takes the value of a GatingSignal of a Gating Mechanism, and uses it to modulate the value of the State to which it projects.

## Creating a GatingProjection¶

A GatingProjection can be created using any of the standard ways to create a projection, or by including it in the specification of an InputState or OutputState . If a GatingProjection is created explicitly (using its constructor), its receiver argument can be specified as a particular InputState or OutputState of a designated Mechanism, or simply as the Mechanism. In the latter case, the Mechanism’s primary InputState will be used. If the GatingProjection is included in an InputState or OutputState specification, that State will be assigned as the GatingProjection’s receiver. If the sender and/or receiver arguments are not specified, its initialization is deferred.

### Deferred Initialization¶

When a GatingProjection is created, its full initialization is deferred until its sender and receiver have been fully specified. This allows a GatingProjection to be created before its sender and/or receiver have been created (e.g., before them in a script), by calling its constructor without specifying its sender or receiver arguments. However, for the GatingProjection to be operational, initialization must be completed by calling its deferred_init method. This is not necessary if the State(s) to be gated are specified in the gating_signals argument of a GatingMechanism, in which case deferred initialization is completed automatically by the GatingMechanism when it is created.

## Structure¶

The sender of a GatingProjection is a GatingSignal of a Gating Mechanism. The value of the sender is used by the GatingProjection as its variable; this is also assigned to its gating_signal attribute, and serves as the input to the GatingProjection’s function. The default function for a GatingProjection is an identity function (Linear with slope=1 and intercept=0); that is, it simply conveys the value of its gating_signal to its receiver, for use in modifying the value of the State that it gates. Its receiver is the InputState or OutputState of a Mechanism.

## Execution¶

A GatingProjection cannot be executed directly. It is executed when the InputState or OutputState to which it projects is updated. Note that this only occurs when the Mechanism to which the State belongs is executed (see Lazy Evaluation for an explanation of “lazy” updating). When a GatingProjection is executed, its function gets the gating_signal from its sender and conveys that to its receiver. This is used by the receiver to modify the value of the State gated by the GatingProjection (see Modulation, InputState Execution and OutputState Execution for how modulation operates and how this applies to a InputStates and OutputStates).

Note

The changes in an InputState or OutputState’s value in response to the execution of a GatingProjection are not applied until the Mechanism to which the State belongs is next executed; see Lazy Evaluation for an explanation of “lazy” updating).

## Class Reference¶

class psyneulink.core.components.projections.modulatory.gatingprojection.GatingProjection(sender=None, receiver=None, function=Linear weight=None, exponent=None, gating_signal_params=None, params=None, name=None, prefs=None)

Subclass of ModulatoryProjection that modulates the value of an InputState or OutputState.

Parameters: sender (Optional[GatingMechanism or GatingSignal]) – specifies the source of the gating_signal for the GatingProjection; if it is not specified and cannot be inferred from context , initialization is deferred. receiver (Optional[Mechanism, InputState or OutputState]) – specifies the InputState or OutputState to which the GatingProjection projects; if it is not specified, and cannot be inferred from context, initialization is deferred. function (TransferFunction : default Linear(slope=1, intercept=0)) – specifies the function used to convert the gating_signal to the GatingProjection’s value. weight (number : default None) – specifies the value by which to multiply the GatingProjection’s value before combining it with others (see weight for additional details). exponent (number : default None) – specifies the value by which to exponentiate the GatingProjection’s value before combining it with others (see exponent for additional details). gating_signal_params (Dict[param keyword: param value]) – a parameter dictionary that can be used to specify the parameters for the GatingProjection’s sender (see Structure for a description of GatingSignal parameters). params (Dict[param keyword: param value] : default None) – a parameter dictionary that can be used to specify the parameters for the GatingProjection, its function, and/or a custom function and its parameters. Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor. name (str : default see ModulatoryProjection name) – specifies the name of the GatingProjection. prefs (PreferenceSet or specification dict : default Projection.classPreferences) – specifies the PreferenceSet for the GatingProjection; see prefs for details.
componentType

GATING_PROJECTION

sender

GatingSignal – source of the gating_signal.

receiver

InputState or OutputState of a MechanismInputState or OutputState to which the GatingProjection projects.

variable

2d np.array – same as gating_signal.

gating_signal

1d np.array – the value of the GatingProjection’s sender.

function

Function – assigns the gating_signal received from the sender to the GatingProjection’s value; the default is an identity function.

value

float – the value used to modify the value of the InputState or OutputState gated by the GatingProjection (see Modulation, InputState Execution, and OutputState Execution for how modulation operates and how this applies to InputStates and OutputStates).

weight

number – multiplies the value of the GatingProjection after applying exponent, and before combining it with any others that project to the same InputState or OutputState to determine how that State’s variable is modified (see description in Projection for details).

exponent
number – exponentiates the value of the GatingProjection, before applying weight
<ControlProjection.weight>, and before combining it with any others that project to the same InputState

or OutputState to determine how that State’s variable is modified (see description in Projection for details).

name

str – name of the GatingProjection; if it is not specified in the name argument of its constructor, a default name is assigned (see ModulatoryProjection name; also see Naming for conventions regarding duplicate names).

prefs

PreferenceSet or specification dict – the PreferenceSet for the GatingProjection; if it is not specified in the prefs argument of the constructor, a default is assigned using classPreferences defined in __init__.py (see PreferenceSet for details).