AutoAssociativeProjection

Overview

An AutoAssociativeProjection is a subclass of MappingProjection that acts as the recurrent projection for a RecurrentTransferMechanism. The primary difference between an AutoAssociativeProjection and a basic MappingProjection is that an AutoAssociativeProjection uses the auto and hetero parameters on the RecurrentTransferMechanism to help update its matrix: this allows for a ControlMechanism to control the auto and hetero parameters and thereby control the matrix.

Creating an AutoAssociativeProjection

An AutoAssociativeProjection is created automatically by a RecurrentTransferMechanism (or its subclasses), and is stored as the recurrent_projection parameter of the RecurrentTransferMechanism. It is not recommended to create an AutoAssociativeProjection on its own, because during execution an AutoAssociativeProjection references parameters owned by its RecurrentTransferMechanism (see Execution below).

Auto Associative Structure

In structure, the AutoAssociativeProjection is almost identical to a MappingProjection: the only additional attributes are auto and hetero.

Configurable Attributes

Due to its specialized nature, most parameters of the AutoAssociativeProjection are not configurable: the variable is determined by the format of the output of the RecurrentTransferMechanism, the function is always LinearMatrix, and so on. The only configurable parameter is the matrix, configured through the matrix, auto, and/or hetero arguments for a RecurrentTransferMechanism:

  • matrix - multiplied by the input to the AutoAssociativeProjection in order to produce the output. Specification of the matrix, auto, and/or hetero arguments determines the values of the matrix; auto determines the diagonal entries (representing the strength of the connection from each node to itself) and hetero determines the off-diagonal entries (representing connections between nodes).

Execution

An AutoAssociativeProjection uses its matrix parameter to transform the value of its sender, and provide the result as input for its receiver, the primary input state of the RecurrentTransferMechanism.

Note

During execution the AutoAssociativeProjection updates its matrix and hetero parameters on the `RecurrentTransferMechanism`. (The auto and hetero parameters of the AutoAssociativeProjection simply refer to their counterparts on the RecurrentTransferMechanism as well.) The reason for putting the auto and hetero parameters on the RecurrentTransferMechanism is that this allows them to be modified by a ControlMechanism.

Class Reference

class psyneulink.library.projections.pathway.autoassociativeprojection.AutoAssociativeProjection(owner=None, sender=None, receiver=None, matrix=DEFAULT_MATRIX, params=None, name=None, prefs=None context=None)

Implements a MappingProjection that is self-recurrent on a RecurrentTransferMechanism; an AutoAssociativeProjection represents connections between nodes in a single-layer recurrent network. It multiplies the output of the RecurrentTransferMechanism by a matrix, then presents the product as input to the RecurrentTransferMechanism.

Parameters:
  • owner (Optional[Mechanism]) – simply specifies both the sender and receiver of the AutoAssociativeProjection. Setting owner=myMechanism is identical to setting sender=myMechanism and receiver=myMechanism.
  • sender (Optional[OutputState or Mechanism]) – specifies the source of the Projection’s input. If a Mechanism is specified, its primary OutputState will be used. If it is not specified, it will be assigned in the context in which the Projection is used.
  • receiver (Optional[InputState or Mechanism]) – specifies the destination of the Projection’s output. If a Mechanism is specified, its primary InputState will be used. If it is not specified, it will be assigned in the context in which the Projection is used.
  • matrix (list, np.ndarray, np.matrix, function or keyword : default DEFAULT_MATRIX) – the matrix used by function (default: LinearCombination) to transform the value of the sender.
  • params (Dict[param keyword: param value] : default None) – a parameter dictionary that can be used to specify the parameters for the Projection, its function, and/or a custom function and its parameters. By default, it contains an entry for the Projection’s default assignment (LinearCombination). Values specified for parameters in the dictionary override any assigned to those parameters in arguments of the constructor.
  • name (str : default AutoAssociativeProjection-<index>) – a string used for the name of the AutoAssociativeProjection. When an AutoAssociativeProjection is created by a RecurrentTransferMechanism, its name is assigned “<name of RecurrentTransferMechanism> recurrent projection” (see Registry for conventions used in naming, including for default and duplicate names).
  • prefs (Optional[PreferenceSet or specification dict : Projection_Base.classPreferences]) – the PreferenceSet for the MappingProjection; if it is not specified, a default is assigned using classPreferences defined in __init__.py (see PreferenceSet for details).
componentType

AUTO_ASSOCIATIVE_PROJECTION

sender

OutputState – identifies the source of the Projection’s input.

receiver

InputState – identifies the destination of the Projection.

learning_mechanism

LearningMechanism – source of error signal for that determine changes to the matrix when learning is used.

matrix

2d np.ndarray – matrix used by function to transform input from the sender to the value provided to the receiver.

auto

number or 1d np.ndarray – diagonal terms of the matrix used by the AutoAssociativeProjection: if auto is a single number, it means the diagonal is uniform.

hetero

number or 2d np.ndarray – off-diagonal terms of the matrix used by the AutoAssociativeProjection: if hetero is a single number, it means the off-diagonal terms are all the same.

has_learning_projection

bool : False – identifies whether the AutoAssociativeProjection’s MATRIX ParameterState has been assigned a LearningProjection.

value

np.ndarray – Output of AutoAssociativeProjection, transmitted to variable of receiver.

name

str – a string used for the name of the AutoAssociativeProjection (see Registry for conventions used in naming, including for default and duplicate names).

prefs

PreferenceSet or specification dict : Projection_Base.classPreferences – the PreferenceSet for AutoAssociativeProjection (see PreferenceSet for details).