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

Feat/em composition learning #2746

Merged
merged 176 commits into from
Jul 26, 2023
Merged

Feat/em composition learning #2746

merged 176 commits into from
Jul 26, 2023

Conversation

jdcpni
Copy link
Collaborator

@jdcpni jdcpni commented Jul 25, 2023

EMComposition.py: docstring mods

jdcpni added 30 commits July 2, 2023 12:22
  - all_entries_identical()
  first draft of module that implements episodic / external memory Composition
  - add error message for specifcation of default_control_allocation or default_gating_allocation
  - add error message for specifcation of default_control_allocation or default_gating_allocation
  - add error message for specifcation of default_control_allocation or default_gating_allocation
 - constructs but wiring still not right
 - first draft; needs to be run
 - add memory decay and storage
 - storage and retrieval working
 - exclude value_input_nodes as NodeRole.OUTPUT
 - TODO notes
 - suppress warning for no efferent projectsions
  - add storage_prob and related parameters
  - docs in progress
• emcomposition.py
  - doc mods
• emcomposition.py
  - normalize dot products for match_nodes
  (still needs compiled version)
• emcomposition.py
  - doc mods
• emcomposition.py
  - implement various Parameters
  - add keys to retrieval nodes
• emcomposition.py
  - field_names implemented
• emcomposition.py
  - adaptive softmax gain implemented
• emcomposition.py
  - match_nodes -> softmax_nodes
• emcomposition.py
  - split match_nodes and softmax_nodes
• emcomposition.py
  - implement adpative softmax control
jdcpni and others added 23 commits July 21, 2023 13:11
  - BackPropagation._function(): remove error_matrix from signature
  - BackPropagation._function(): remove error_matrix from signature
  - EMStorage(): partially implemented
  - BackPropagation._function(): remove error_matrix from signature

• EMstoragemechanism.py
  - partially implmeneted

• emcomposition.py
  - _construct_storage_node(): partially implemented

• Project: remove residual references to System and Process
  - EMStorage(): partially implemented
  - BackPropagation._function(): remove error_matrix from signature

• EMstoragemechanism.py
  - partially implmeneted

• emcomposition.py
  - _construct_storage_node(): partially implemented

• Project: remove residual references to System and Process
  - EMStorage(): partially implemented
  - BackPropagation._function(): remove error_matrix from signature

• learning_mechanism.py
  - _instantiate_output_ports: support specification dictionary for learning_signal

• projection.py
  - change assert to exception with improved error messages if port_spec is bad

• EMstoragemechanism.py
  - partially implmeneted

• emcomposition.py
  - _construct_storage_node(): partially implemented

• Project: remove residual references to System and Process
  - EMStorage(): partially implemented
  - BackPropagation._function(): remove error_matrix from signature

• learning_mechanism.py
  - _instantiate_output_ports: support specification dictionary for learning_signal

• projection.py
  - change assert to exception with improved error messages if port_spec is bad

• EMstoragemechanism.py
  - implemented and passing tests

• emcomposition.py
  - _construct_storage_node(): partially implemented

• Project: remove residual references to System and Process
  - EMStorage(): partially implemented
  - BackPropagation._function(): remove error_matrix from signature

• learning_mechanism.py
  - _instantiate_output_ports: support specification dictionary for learning_signal

• projection.py
  - change assert to exception with improved error messages if port_spec is bad

• EMstoragemechanism.py
  - implemented and passing tests

• emcomposition.py
  - _construct_storage_node(): partially implemented

• Project: remove residual references to System and Process
  - EMStorage(): partially implemented
  - BackPropagation._function(): remove error_matrix from signature

• learning_mechanism.py
  - _instantiate_output_ports: support specification dictionary for learning_signal

• projection.py
  - change assert to exception with improved error messages if port_spec is bad

• EMstoragemechanism.py
  - implemented and passing tests

• emcomposition.py
  - _construct_storage_node(): partially implemented

• Project: remove residual references to System and Process
  - version with EMStorageMechanism passes all tests
  - Fixed import of Literal
  - test_execution: add tests for concatenation

• emstoragemechanism.py
  - implement names of learning_signals

• learningmechanism.py
  - _instantiate_output_ports: remove imposition of "LearningSignal" as name
  - docstring mods
  - docstring mods
@github-actions
Copy link

This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):

diff -r docs-base/EMComposition.html docs-head/EMComposition.html
470c470
< from the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_weighting_node</span></code></a> to each of the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_nodes</span></code></a>.  Memories associated with each key are also stored in the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameters of the <code class="xref any docutils literal notranslate"><span class="pre">MappingProjections</span></code> from the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">key_input_nodes</span></code></a> to each of the corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.match_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.match_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">match_nodes</span></code></a>.
---
> from the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_weighting_node</span></code></a> to each of the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_nodes</span></code></a>. Memories associated with each key are also stored in the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameters of the <code class="xref any docutils literal notranslate"><span class="pre">MappingProjections</span></code> from the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">key_input_nodes</span></code></a> to each of the corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.match_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.match_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">match_nodes</span></code></a>.
472,473c472,474
< by passing the input for each key through the Projection to the corresponding match_node and, similarly,
< retrieivals can be computed by passiing the softmax disintributions and weighting for each field computed
---
> by passing the input for each key through the Projection (which computes the dot product of the input with
> the Projection’s <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter) to the corresponding match_node; and, similarly,
> retrieivals can be computed by passing the softmax disintributions and weighting for each field computed
475c476,477
< <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_node</span></code></a> to get the retreieved value for each field.</p>
---
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_node</span></code></a> (which computes the dot product of the weighted softmax over
> entries with the corresponding field of each entry) to get the retreieved value for each field.</p>
532c534,535
< are added as a new entry in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a>, replacing the weakest one if <a class="reference internal" href="#emcomposition-memory-capacity"><span class="std std-ref">memory_capacity</span></a> has been reached.</p>
---
> are added by the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_node" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_node</span></code></a> as a new entry in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a>,
> replacing the weakest one if <a class="reference internal" href="#emcomposition-memory-capacity"><span class="std std-ref">memory_capacity</span></a> has been reached.</p>
539,541c542,544
< corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.match_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.match_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">match_node</span></code></a>.  If <a class="reference internal" href="#emcomposition-memory-capacity"><span class="std std-ref">memory_capacity</span></a>
< has been reached, then the weakest memory (i.e., the one with the lowest norm across all fields) is replaced by
< the new memory.</p>
---
> corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.match_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.match_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">match_node</span></code></a> (see note <a class="reference internal" href="#emcomposition-memory-storage"><span class="std std-ref">above</span></a> for
> additional details). If <a class="reference internal" href="#emcomposition-memory-capacity"><span class="std std-ref">memory_capacity</span></a> has been reached, then the weakest
> memory (i.e., the one with the lowest norm across all fields) is replaced by the new memory.</p>
728c731
< <li><p><strong>concatenate_keys</strong> (<em>bool : default True</em>) – specifies whether to concatenate the keys into a single field before matching them to items in
---
> <li><p><strong>concatenate_keys</strong> (<em>bool : default False</em>) – specifies whether to concatenate the keys into a single field before matching them to items in
900c903,906
< to be retrieved from <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a>, and then themselves stored in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a> (see <a class="reference internal" href="#emcomposition-processing"><span class="std std-ref">Match memories by field</span></a> for additional details).</p>
---
> to be retrieved from <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a>, and then themselves stored in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a> (see <a class="reference internal" href="#emcomposition-processing"><span class="std std-ref">Match memories by field</span></a> for additional details).
> By default these are assigned the name <em>KEY_n_INPUT</em> where n is the field number (starting from 0);
> however, if <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.field_names" title="psyneulink.library.compositions.emcomposition.EMComposition.field_names"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_names</span></code></a> is specified, then the name of each key_input_node
> is assigned the corresponding field name.</p>
911c917,919
< <dd><p><a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.INPUT" title="psyneulink.core.compositions.composition.NodeRole.INPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">INPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> that receive values to be stored in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a>; these are not used in the matching process used for retrieval</p>
---
> <dd><p><a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.INPUT" title="psyneulink.core.compositions.composition.NodeRole.INPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">INPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> that receive values to be stored in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a>; these are not used in the matching process used for retrieval.  By default these
> are assigned the name <em>VALUE_n_INPUT</em> where n is the field number (starting from 0);  however, if
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.field_names" title="psyneulink.library.compositions.emcomposition.EMComposition.field_names"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_names</span></code></a> is specified, then the name of each value_input_node is assigned</p>
924c932
< This is not created if the <code class="docutils literal notranslate"><span class="pre">contatenate_keys</span></code> argument to the EMComposition’s constructor is False or is
---
> This is not created if the <code class="docutils literal notranslate"><span class="pre">concatenate_keys</span></code> argument to the EMComposition’s constructor is False or is
937c945,946
< the corresponding field of <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a> (see <a class="reference internal" href="#emcomposition-processing"><span class="std std-ref">Match memories by field</span></a> for additional details).</p>
---
> the corresponding field of <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a> (see <a class="reference internal" href="#emcomposition-processing"><span class="std std-ref">Match memories by field</span></a> for additional details).  These are assigned names that prepend <em>MATCH_n</em> to the
> name of the corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">key_input_nodes</span></code></a>.</p>
1001c1010,1013
< <dd><p><a class="reference internal" href="TransferMechanism.html"><span class="doc">TransferMechanisms</span></a> that receive the vector retrieved for each field in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a> (see <a class="reference internal" href="#emcomposition-processing"><span class="std std-ref">Retrieve values by field</span></a> for additional details).</p>
---
> <dd><p><a class="reference internal" href="TransferMechanism.html"><span class="doc">TransferMechanisms</span></a> that receive the vector retrieved for each field in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a> (see <a class="reference internal" href="#emcomposition-processing"><span class="std std-ref">Retrieve values by field</span></a> for additional details);
> these are assigned the same names as the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">key_input_nodes</span></code></a> and
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.value_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.value_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value_input_nodes</sp
...

See CI logs for the full diff.

@@ -143,6 +143,7 @@
"""

import numpy as np
import re

Check notice

Code scanning / CodeQL

Unused import Note

Import of 're' is not used.
self.parameters.learning_signals._set(learning_signal_dicts, context)

return super()._instantiate_output_ports(context=context)
learning_signals = super()._instantiate_output_ports(context=context)

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable learning_signals is not used.
@coveralls
Copy link

coveralls commented Jul 25, 2023

Coverage Status

coverage: 84.563% (-0.004%) from 84.567% when pulling b42a1f1 on feat/em_composition_LEARNING into 4eeee5c on devel.

@github-actions
Copy link

This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):

diff -r docs-base/EMComposition.html docs-head/EMComposition.html
470c470
< from the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_weighting_node</span></code></a> to each of the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_nodes</span></code></a>.  Memories associated with each key are also stored in the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameters of the <code class="xref any docutils literal notranslate"><span class="pre">MappingProjections</span></code> from the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">key_input_nodes</span></code></a> to each of the corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.match_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.match_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">match_nodes</span></code></a>.
---
> from the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_weighting_node</span></code></a> to each of the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_nodes</span></code></a>. Memories associated with each key are also stored in the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameters of the <code class="xref any docutils literal notranslate"><span class="pre">MappingProjections</span></code> from the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">key_input_nodes</span></code></a> to each of the corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.match_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.match_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">match_nodes</span></code></a>.
472,473c472,474
< by passing the input for each key through the Projection to the corresponding match_node and, similarly,
< retrieivals can be computed by passiing the softmax disintributions and weighting for each field computed
---
> by passing the input for each key through the Projection (which computes the dot product of the input with
> the Projection’s <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter) to the corresponding match_node; and, similarly,
> retrieivals can be computed by passing the softmax disintributions and weighting for each field computed
475c476,477
< <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_node</span></code></a> to get the retreieved value for each field.</p>
---
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_node</span></code></a> (which computes the dot product of the weighted softmax over
> entries with the corresponding field of each entry) to get the retreieved value for each field.</p>
532c534,535
< are added as a new entry in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a>, replacing the weakest one if <a class="reference internal" href="#emcomposition-memory-capacity"><span class="std std-ref">memory_capacity</span></a> has been reached.</p>
---
> are added by the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_node" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_node</span></code></a> as a new entry in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a>,
> replacing the weakest one if <a class="reference internal" href="#emcomposition-memory-capacity"><span class="std std-ref">memory_capacity</span></a> has been reached.</p>
539,541c542,544
< corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.match_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.match_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">match_node</span></code></a>.  If <a class="reference internal" href="#emcomposition-memory-capacity"><span class="std std-ref">memory_capacity</span></a>
< has been reached, then the weakest memory (i.e., the one with the lowest norm across all fields) is replaced by
< the new memory.</p>
---
> corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.match_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.match_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">match_node</span></code></a> (see note <a class="reference internal" href="#emcomposition-memory-storage"><span class="std std-ref">above</span></a> for
> additional details). If <a class="reference internal" href="#emcomposition-memory-capacity"><span class="std std-ref">memory_capacity</span></a> has been reached, then the weakest
> memory (i.e., the one with the lowest norm across all fields) is replaced by the new memory.</p>
728c731
< <li><p><strong>concatenate_keys</strong> (<em>bool : default True</em>) – specifies whether to concatenate the keys into a single field before matching them to items in
---
> <li><p><strong>concatenate_keys</strong> (<em>bool : default False</em>) – specifies whether to concatenate the keys into a single field before matching them to items in
900c903,906
< to be retrieved from <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a>, and then themselves stored in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a> (see <a class="reference internal" href="#emcomposition-processing"><span class="std std-ref">Match memories by field</span></a> for additional details).</p>
---
> to be retrieved from <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a>, and then themselves stored in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a> (see <a class="reference internal" href="#emcomposition-processing"><span class="std std-ref">Match memories by field</span></a> for additional details).
> By default these are assigned the name <em>KEY_n_INPUT</em> where n is the field number (starting from 0);
> however, if <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.field_names" title="psyneulink.library.compositions.emcomposition.EMComposition.field_names"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_names</span></code></a> is specified, then the name of each key_input_node
> is assigned the corresponding field name.</p>
911c917,919
< <dd><p><a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.INPUT" title="psyneulink.core.compositions.composition.NodeRole.INPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">INPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> that receive values to be stored in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a>; these are not used in the matching process used for retrieval</p>
---
> <dd><p><a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.INPUT" title="psyneulink.core.compositions.composition.NodeRole.INPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">INPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> that receive values to be stored in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a>; these are not used in the matching process used for retrieval.  By default these
> are assigned the name <em>VALUE_n_INPUT</em> where n is the field number (starting from 0);  however, if
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.field_names" title="psyneulink.library.compositions.emcomposition.EMComposition.field_names"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_names</span></code></a> is specified, then the name of each value_input_node is assigned</p>
924c932
< This is not created if the <code class="docutils literal notranslate"><span class="pre">contatenate_keys</span></code> argument to the EMComposition’s constructor is False or is
---
> This is not created if the <code class="docutils literal notranslate"><span class="pre">concatenate_keys</span></code> argument to the EMComposition’s constructor is False or is
937c945,946
< the corresponding field of <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a> (see <a class="reference internal" href="#emcomposition-processing"><span class="std std-ref">Match memories by field</span></a> for additional details).</p>
---
> the corresponding field of <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a> (see <a class="reference internal" href="#emcomposition-processing"><span class="std std-ref">Match memories by field</span></a> for additional details).  These are assigned names that prepend <em>MATCH_n</em> to the
> name of the corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">key_input_nodes</span></code></a>.</p>
1001c1010,1013
< <dd><p><a class="reference internal" href="TransferMechanism.html"><span class="doc">TransferMechanisms</span></a> that receive the vector retrieved for each field in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a> (see <a class="reference internal" href="#emcomposition-processing"><span class="std std-ref">Retrieve values by field</span></a> for additional details).</p>
---
> <dd><p><a class="reference internal" href="TransferMechanism.html"><span class="doc">TransferMechanisms</span></a> that receive the vector retrieved for each field in <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory" title="psyneulink.library.compositions.emcomposition.EMComposition.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory</span></code></a> (see <a class="reference internal" href="#emcomposition-processing"><span class="std std-ref">Retrieve values by field</span></a> for additional details);
> these are assigned the same names as the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">key_input_nodes</span></code></a> and
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.value_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.value_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value_input_nodes</sp
...

See CI logs for the full diff.

@jdcpni jdcpni merged commit 6daa89b into devel Jul 26, 2023
58 of 59 checks passed
@jdcpni jdcpni deleted the feat/em_composition_LEARNING branch July 26, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants