ControlProjection

Overview

A ControlProjection is a type of ModulatoryProjection that projects to the ParameterState of a ProcessingMechanism. It takes the value of a ControlSignal of a ControlMechanism and uses it to modify the value of the parameter associated with the ParameterState to which it projects. All of the ControlProjections in a System, along with its other control components, can be displayed using the System’s show_graph method with its show_control argument assigned as True.

Creating a ControlProjection

A ControlProjection can be created using any of the standard ways to create a Projection, or by including it in a tuple that specifies a parameter for a Mechanism, MappingProjection, or the function of either of these. If a ControlProjection is created explicitly (using its constructor), and its receiver argument is not specified, its initialization is deferred. If it is included in a parameter specification, the ParameterState for the parameter being specified will be assigned as the ControlProjection’s receiver. If its sender argument is not specified, its assignment depends on the receiver. If the receiver belongs to a Mechanism that is part of a System, then the ControlProjection’s sender is assigned to a ControlSignal of the System’s controller. Otherwise, its initialization is deferred.

Deferred Initialization

When a ControlProjection is created, its full initialization is deferred until its sender and receiver have been fully specified. This allows a ControlProjection 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 ControlProjection to be operational, initialization must be completed by calling its deferred_init method. This is not necessary if the ControlProjection is included in a tuple specification for the parameter of a Mechanism or its function, in which case the deferred initialization is completed automatically when the ControlMechanism is created for the System to which the parameter’s owner belongs (see Creating a ControlMechanism).

Structure

The sender of a ControlProjection is a ControlSignal of a ControlMechanism. The value of the sender is used by the ControlProjection as its variable; this is also assigned to its control_signal attribute, and serves as the input to the ControlProjection’s function. The default function for a ControlProjection is an identity function (Linear with slope=1 and intercept=0); that is, it simply conveys the value of its control_signal to its receiver, for use in modifying the value of the parameter that it controls. Its receiver is the ParameterState for the parameter of the Mechanism or its function that is controlled by the ControlProjection.

Execution

A ControlProjection cannot be executed directly. It is executed when the ParameterState to which it projects is updated. Note that this only occurs when the Mechanism to which the ParameterState belongs is executed (see Lazy Evaluation for an explanation of “lazy” updating). When a ControlProjection is executed, its function gets the control_signal from its sender and conveys that to its receiver. This is used by the receiver to modify the parameter controlled by the ControlProjection (see Modulation and ParameterState Execution for how modulation operates and how this applies to a ParameterState).

Note

The changes to a parameter in response to the execution of a ControlProjection are not applied until the Mechanism that receives the ControlProjection are next executed; see Lazy Evaluation for an explanation of “lazy” updating).

Class Reference

class psyneulink.components.projections.modulatory.controlprojection.ControlProjection(sender=None, receiver=None, function=Linear, weight=None, exponent=None, control_signal_params=None, params=None, name=None, prefs=None)

Subclass of ModulatoryProjection that modulates the value of a ParameterState of a Mechanism.

Parameters:
  • sender (Optional[ControlMechanism or ControlSignal]) – specifies the source of the control_signal for the ControlProjection; if it is not specified and cannot be inferred from context, initialization is deferred.
  • receiver (Optional[Mechanism or ParameterState]) – specifies the ParameterState associated with the parameter to be controlled; 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 control_signal to the ControlProjection’s value.
  • weight (number : default None) – specifies the value by which to multiply the ControlProjection’s value before combining it with others (see weight for additional details).
  • exponent (number : default None) – specifies the value by which to exponentiate the ControlProjection’s value before combining it with others (see exponent for additional details).
  • pip install --updgrade Sphinx==1.6.2 sphinx-rtd-theme==0.2.4 sphinxcontrib-websupport==1.0.1 (control_signal_params) – a parameter dictionary that can be used to specify the parameters for the ControlProjection’s sender (see Structure for a description of ControlSignal parameters).
  • params (Dict[param keyword: param value] : default None) – a parameter dictionary that can be used to specify the parameters for the ControlProjection, 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 ControlProjection.
  • prefs (PreferenceSet or specification dict : default Projection.classPreferences) – specifies the PreferenceSet for the ControlProjection; see prefs for details.
componentType

CONTROL_PROJECTION

sender

ControlSignal – source of the control_signal.

receiver

ParameterState of MechanismParameterState for the parameter to be modified by the ControlProjection.

variable

2d np.array – same as control_signal.

control_signal

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

function

Function – assigns the control_signal received from the sender to the ControlProjection’s value; the default in an identity function.

value

float – the value used to modify the parameter controlled by the ControlProjection (see Modulation and ParameterState Execution for how modulation operates and how this applies to a ParameterState).

weight

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

exponent

number – exponentiates the value of the ControlProjection, before applying weight, and before combining it with any others that project to the same ParameterState to determine how that ParameterState’s variable is modified (see description in Projection for details).

name

str – name of the ControlProjection; 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 ControlProjection; 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).