A ContrastiveHebbianMechanism always has two, and possibly three InputStates:
- INPUT: receives external input to the Mechanism;
- TARGET: only implemented if target_size is specified, **separated =
True (default), and
mode is not SIMPLE_HEBBIAN; receives the
specified in the
run method of any System to which the Mechanism belongs.
The sizes of these are determined by arguments in its constructor, which generally conform to one of two
Standard Configuration – if input_size, hidden_size and target_size are all specified,
the sizes of the InputStates are as follows:
INPUT: size = input_size
RECURRENT: size = input_size + hidden_size + target_size
TARGET: size = input_size
Simple Configuration – if target_size =
None or 0, separated =
False, and/or mode =
SIMPLE_HEBBIAN, the sizes of the InputStates are as follows:
INPUT: size = input_size
RECURRENT: size = input_size + hidden_size
TARGET: Not implemented
If separated =
False and target_size is specified, a TARGET InputState will be created, but
target_size must equal input_size or an error will be generated.
The values of input_size, hidden_size and target_size are assigned to the Mechanism’s
target_size attributes, respectively.
(if separated is
True) attribute(s), together with the separated attribute
are used to define the fields of the RECURRENT InputState’s
value and the current_activity attribute used for updating values during execution,
- input_field: the leftmost number of elements determined by
- hidden_field: the elements of the RECURRENT InputState and current_activity
that are not within the input_field and/or target_field;
- target_field: the rightmost number of elements determined by
otherwise, the same as input_field.
A ContrastiveHebbianMechanism is automatically assigned three OutputStates:
- OUTPUT_ACTIVITY_OUTPUT: assigned as the primary OutputState, and contains the pattern
of activity the Mechanism is trained to generate. If target_size is specified, then it has the same size as
the TARGET InputState; if target_size is not specified or is 0, if
False, or if mode is SIMPLE_HEBBIAN, then the size of the
OUTPUT_ACTIVITY_OUTPUT OutputState is the same as the INPUT InputState (see Input).
- CURRENT_ACTIVITY_OUTPUT: assigned the value of the
attribute after each execution of the Mechanism, which contains the activity of all
processing units in the Mechanism (input, hidden and/or target); has the same size as the RECURRENT InputState.
A ContrastiveHebbianMechanism also has two additional Standard OutputStates – PLUS_PHASE_ACTIVITY_OUTPUT and MINUS_PHASE_OUTPUT –
that it can be assigned, as well as those of a RecurrentTransferMechanism or TransferMechanism.