ModulatoryProjection¶
Subclasses
Contents¶
Overview¶
A ModulatoryProjection is a subclass of Projection that takes the value of a ModulatorySignal belonging to a ModulatoryMechanism, and uses that to modulate the function of the Port to which it projects. There are three types of ModulatoryProjections, that modulate different types of Components and their Ports:
- LearningProjection
takes the
value
of a LearningSignal belonging to a LearningMechanism, and conveys it to the MATRIX ParameterPort of a MappingProjection, for use by itsfunction
in modulating the value of the MappingProjection’smatrix
parameter.
- ControlProjection
takes the
value
of a ControlSignal belonging to a ControlMechanism, and conveys it to the ParameterPort for the parameter of a Mechanism or itsfunction
, for use in modulating the value of the parameter.
- GatingProjection
takes the
value
of a GatingSignal belonging to a Gating Mechanism, and conveys it to the InputPort or OutputPort of a ProcessingMechanism for use by the Port’sfunction
in modulating itsvalue
.
See ModulatoryMechanism for conventions used for the names of Modulatory components.
Creating a ModulatoryProjection¶
A ModulatoryProjection is a base class, and cannot be instantiated directly. However, the three types of ModulatoryProjections listed above can be created directly, by calling the constructor for the desired type. More commonly, however, ModulatoryProjections are either specified in the context of the Ports to or from which they project (Projections in Port, and Specifying a Projection), or are created automatically, the details of which are described in the documentation for each type of ModulatoryProjection.
Structure¶
A ModulatoryProjection has the same basic structure as a Projection, augmented by type-specific
attributes and methods described under each type of ModulatoryProjection. The ModulatoryProjections received by a
Port are listed in the Port’s mod_afferents
attribute.
Execution¶
A ModulatoryProjection, like any Projection, cannot be executed directly. It is executed when the Port to
which it projects — its receiver
— is updated; that occurs when the Port’s owner
Mechanism is executed. When a ModulatoryProjection executes, it conveys both the value
of
the ModulatorySignal from which it projects, and the ModulatorySignal’s modulation
attribute, to the Port that receives the Projection. The Port assigns the value to
the parameter of the Port’s function
specified by the modulation
attribute, and then calls
the function
to determine the value
of the Port.
Note
The change made to the parameter of the Port’s Function in response to the execution of a ModulatoryProjection are not applied until the Port is updated which, in turn, does not occur until the Mechanism to which the Port belongs is next executed; see Lazy Evaluation for an explanation of “lazy” updating).
Class Reference¶
- class psyneulink.core.components.projections.modulatory.modulatoryprojection.ModulatoryProjection_Base(receiver, sender=None, weight=None, exponent=None, function=None, feedback=None, exclude_in_autodiff=False, params=None, name=None, prefs=None, context=None, **kwargs)¶
Subclass of Projection that modulates the value of a Port. See Projection and subclasses for arguments and additonal attributes.
Note
ModulatoryProjection is an abstract class and should never be instantiated by a call to its constructor. It should be instantiated using the constructor for a subclass.
- name¶
the name of the ModulatoryProjection. If the ModulatoryProjection’s initialization has been deferred, it is assigned a temporary name (indicating its deferred initialization status) until initialization is completed, at which time it is assigned its designated name. If that is the name of an existing ModulatoryProjection, it is appended with an indexed suffix, incremented for each ModulatoryProjection with the same base name (see Naming). If the name is not specified in the name argument of its constructor, a default name is assigned using the following format: ‘<ModualatorySignal type> for <receiver owner Mechanism’s name>[<receiver’s name>]’ (for example,
'GatingSignal for my_mech[InputPort-0]'
).- Type
str