Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/mechanism/targets_in_output_labels_dict #756

Merged
merged 1 commit into from
Apr 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .idea/runConfigurations/Make_HTML.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions psyneulink/components/mechanisms/mechanism.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,12 +687,19 @@ class `UserList <https://docs.python.org/3.6/library/collections.html?highlight=
The labels specified in these dictionaries can be used to specify items in the `inputs <Run_Inputs>` and `targets
<Run_Targets>` arguments of the `run <System.run>` method of a `System`, and to report the values of the InputState(s)
and OutputState(s) of a Mechanism in a System's `show_graph <System.show_graph>` method (using its **use_values**
option). The labels for the current value(s) of the Mechanism's InputState(s) and OutputState(s) are listed in its
`input_labels <Mechanism_Base.input_labels>` and `output_labels <Mechanism_Base.output_labels>`, respectively.
option). If they are used to specify `targets <Run_Targets>`, they must be included in the `output_labels_dict
<Mechanism_Base.output_labels_dict>` of the Mechanism that projects to the `TARGET` Mechanism (see `TARGET Mechanisms
<LearningMechanism_Targets>`, the last one in a `learning sequence <Process_Learning_Sequence>`.

The labels for the current value(s) of the Mechanism's InputState(s) and OutputState(s) are listed in its
`input_labels <Mechanism_Base.input_labels>` and `output_labels <Mechanism_Base.output_labels>` attributes,
respectively.

*Specifying label dictionaries*

Label dictionaries can only be specified in a parameters dictionary assigned to the **params** argument of the
Mechanism's constructor, using the keywords listed above. A given label dictionary must contain entries *all* of which
use *only one* of the two following formats for the *key:value* pair of each entry:
Mechanism's constructor, using the keywords described above. A given label dictionary must contain entries *all*
of which use *only one* of the two following formats for the *key:value* pair of each entry:

* *label:value* -- the *label* is a string to be associated with the specified value of the State. If the
Mechanism has more than one State of the type corresponding to the dictionary, then the label will be used for
Expand All @@ -710,7 +717,7 @@ class `UserList <https://docs.python.org/3.6/library/collections.html?highlight=
`output_states <Mechanism_Base.output_states>`), and the value a subdictionary containing *label:value* entries
to be used for that State. For example, if a Mechanism has two InputStates, named *SAMPLE* and *TARGET*, then
*INPUT_LABELS_DICT* could be assigned two entries, *SAMPLE*:<dict> and *TARGET*:<dict> or, correspondingly,
0:<dict> and 1:<dict>, in which each dict contained separate *label:value* entries for each of the two
0:<dict> and 1:<dict>, in which each dict contained separate *label:value* entries for the *SAMPLE* and *TARGET*
InputStates.
COMMENT:
ADD EXAMPLE HERE
Expand Down
3 changes: 2 additions & 1 deletion psyneulink/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ class MechanismRole(Enum):
`run <ComparatorMechanism.ComparatorMechanism.execute>` method. It must be associated with the `TERMINAL`
Mechanism of the Process or System. The `TARGET` Mechanisms of a Process or System are listed in its
:keyword:`target_mechanisms` attribute, and can be displayed using its :keyword:`show` method. For additional
details, see `TARGET mechanisms <LearningProjection_Targets>` and specifying `target values <Run_Targets>`.
details, see `TARGET Mechanisms <LearningMechanism_Targets>`, `learning sequence <Process_Learning_Sequence>`,
and specifying `target values <Run_Targets>`.

- RECURRENT_INIT
.
Expand Down
9 changes: 5 additions & 4 deletions psyneulink/globals/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ class MechanismRoles:
TARGET
A `ComparatorMechanism` of a `Process` and/or `System` configured for learning that receives a target value
from its `execute <ComparatorMechanism.ComparatorMechanism.execute>` or
`run <ComparatorMechanism.ComparatorMechanism.execute>` method. It must be associated with the `TERMINAL`
Mechanism of the Process or System. The `TARGET` Mechanisms of a Process or System are listed in its
:keyword:`target_mechanisms` attribute, and can be displayed using its :keyword:`show` method. For additional
details, see `TARGET Mechanisms <LearningMechanism_Targets>` and specifying `target values <Run_Targets>`.
`run <ComparatorMechanism.ComparatorMechanism.execute>` method. It is usually (but not necessarily)
associated with the `TERMINAL` Mechanism of the Process or System. The `TARGET` Mechanisms of a Process or
System are listed in its :keyword:`target_mechanisms` attribute, and can be displayed using its
:keyword:`show` method. For additional details, see `TARGET Mechanisms <LearningMechanism_Targets>`,
`learning sequence <Process_Learning_Sequence>`, and specifying `target values <Run_Targets>`.


"""
Expand Down