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

refactor/emcomposition_field_handling #3122

Merged
merged 58 commits into from
Nov 22, 2024

Conversation

jdcpni
Copy link
Collaborator

@jdcpni jdcpni commented Nov 20, 2024

This reconfigures some of the API for EMComposition, including:

  • the addition of a fields argument that consolidates field specifications into dictionary format,
  • addition of a target_fields argument that specifies which fields are used to compute error during learning,
  • reassigns the enable_learning and learn_field_weights arguments to more intuitive meanings.
  • treats field_weight_nodes as bias units to enable them for learning

Specific changes are:

• emcomposition.py

  • fields argument added to constructor, that takes a dict with keys that are field_names and values that are field_weight, learn_field_weight, and target_fields specifications.
  • enable_learning swapped with learn_field_weights, so that enable_learning is now an on-off switch for learning, and learn_field_weights can be used to specify learning (and learning_rate) for individual field_weights.
  • refactored so that assigning None to field_weights commits field to being a value, and suppresses construction of field_weights_node, whereas use of 0 for a field_weight now implements the field_weights_node that can be modified later.
  • target_fields Parameter added that specify which fields are used to compute and back propagate error
  • _identify_target_nodes():
    refactor to use target_fields instead of learn_field_weights
  • add self._field_index_map that assigns each field an index used to identify its nodes and projections.
  • update docstring figures

• autodiffcomposition.py

  • infer_backpropagation_learning_pathways(): add NodeRole.BIAS to pathways consructed for learning

• pytorchEMcompositionwrapper.py

  • store_memory(): use self._field_index_map to assign memories to fields

• test_emcomposition.py

  • test_backpropagation_of_error_in_learning()

jdcpni added 30 commits October 31, 2024 08:38
  _parse_fields:  clean up assignment of self.num_fields
• emcomposition.py
  passes em_composition tests with field_weights=None => value
• test_emcomposition.py
  ad test_assign_field_weights_and_0_vs_None()
PASSES ALL TESTS
• test_emcomposition.py
  add test_field_weights_all_None_and_or_0
• emcomposition.py
  - revamp docstring to document new mods
  - add fields arg to specify field_naes, field_weights, learn_field_weights
• emcomposition.py
  - revamp docstring to document new mods
  - implement fields arg to specify field_names, field_weights, learn_field_weights in dict format
  - implement support for field-specific learn_field_weight specifications
• emcomposition.py
  - _identify_target_nodes():
    refactor to use target_fields instead of learn_field_weights
  - add target_fields to fields specification dict
• emcomposition.py
  add dict spec for entries in fields arg
  - update docstring figs
Copy link

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

diff -r docs-base/AutoAssociativeProjection.html docs-head/AutoAssociativeProjection.html
246,247c246,247
< <p>Due to its specialized nature, most parameters of the AutoAssociativeProjection are not configurable: the <a class="reference internal" href="LeabraMechanism.html#psyneulink.library.components.mechanisms.processing.leabramechanism.LeabraFunction.variable" title="psyneulink.library.components.mechanisms.processing.leabramechanism.LeabraFunction.variable"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">variable</span></code></a> is
< determined by the format of the output of the RecurrentTransferMechanism, the <a class="reference internal" href="LCControlMechanism.html#psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function" title="psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> is always MatrixTransform, and so
---
> <p>Due to its specialized nature, most parameters of the AutoAssociativeProjection are not configurable: the <a class="reference internal" href="AutoAssociativeLearningMechanism.html#psyneulink.library.components.mechanisms.modulatory.learning.autoassociativelearningmechanism.AutoAssociativeLearningMechanism.variable" title="psyneulink.library.components.mechanisms.modulatory.learning.autoassociativelearningmechanism.AutoAssociativeLearningMechanism.variable"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">variable</span></code></a> is
> determined by the format of the output of the RecurrentTransferMechanism, the <a class="reference internal" href="AutoAssociativeLearningMechanism.html#psyneulink.library.components.mechanisms.modulatory.learning.autoassociativelearningmechanism.AutoAssociativeLearningMechanism.function" title="psyneulink.library.components.mechanisms.modulatory.learning.autoassociativelearningmechanism.AutoAssociativeLearningMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> is always MatrixTransform, and so
diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
403,404c403,404
< <li><p>the <a class="reference internal" href="KohonenMechanism.html#psyneulink.library.components.mechanisms.processing.transfer.kohonenmechanism.KohonenMechanism.matrix" title="psyneulink.library.components.mechanisms.processing.transfer.kohonenmechanism.KohonenMechanism.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter of Projections</p></li>
< <li><p>the <a class="reference internal" href="LCControlMechanism.html#psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.value" title="psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> parameter of its inner components</p></li>
---
> <li><p>the <a class="reference internal" href="AutoAssociativeProjection.html#psyneulink.library.components.projections.pathway.autoassociativeprojection.AutoAssociativeProjection.matrix" title="psyneulink.library.components.projections.pathway.autoassociativeprojection.AutoAssociativeProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameter of Projections</p></li>
> <li><p>the <a class="reference internal" href="Component.html#psyneulink.core.components.component.Component.value" title="psyneulink.core.components.component.Component.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> parameter of its inner components</p></li>
diff -r docs-base/BotvinickConflictMonitoringModel.html docs-head/BotvinickConflictMonitoringModel.html
273c273
< The <a class="reference internal" href="Log.html#module-psyneulink.core.globals.log" title="psyneulink.core.globals.log"><code class="xref any py py-mod docutils literal notranslate"><span class="pre">log</span></code></a> function is used to record the output values of <em>RESPONSE LAYER</em>. These values are used to produce
---
> The <a class="reference internal" href="Component.html#psyneulink.core.components.component.Component.log" title="psyneulink.core.components.component.Component.log"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">log</span></code></a> function is used to record the output values of <em>RESPONSE LAYER</em>. These values are used to produce
diff -r docs-base/Cohen_HustonModel.html docs-head/Cohen_HustonModel.html
292c292
< <p>The <a class="reference internal" href="Log.html#module-psyneulink.core.globals.log" title="psyneulink.core.globals.log"><code class="xref any py py-mod docutils literal notranslate"><span class="pre">log</span></code></a> function is used to record the output values of the <em>RESPONSE LAYER</em>. The cyles until a threshold is reached
---
> <p>The <a class="reference internal" href="Component.html#psyneulink.core.components.component.Component.log" title="psyneulink.core.components.component.Component.log"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">log</span></code></a> function is used to record the output values of the <em>RESPONSE LAYER</em>. The cyles until a threshold is reached
diff -r docs-base/Component.html docs-head/Component.html
370c370
< <a class="reference internal" href="LCControlMechanism.html#psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function" title="psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> attribute of the Component.</p>
---
> <a class="reference internal" href="AutoAssociativeLearningMechanism.html#psyneulink.library.components.mechanisms.modulatory.learning.autoassociativelearningmechanism.AutoAssociativeLearningMechanism.function" title="psyneulink.library.components.mechanisms.modulatory.learning.autoassociativelearningmechanism.AutoAssociativeLearningMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> attribute of the Component.</p>
398c398
< <p>In general, Components that have an execute() method may use this to assign the <a class="reference internal" href="LCControlMechanism.html#psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.value" title="psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of the Component
---
> <p>In general, Components that have an execute() method may use this to assign the <a class="reference internal" href="#psyneulink.core.components.component.Component.value" title="psyneulink.core.components.component.Component.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of the Component
436c436
< <a class="reference internal" href="KohonenMechanism.html#psyneulink.library.components.mechanisms.processing.transfer.kohonenmechanism.KohonenMechanism.output_ports" title="psyneulink.library.components.mechanisms.processing.transfer.kohonenmechanism.KohonenMechanism.output_ports"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_ports</span></code></a>, and <a class="reference internal" href="Mechanism.html#psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.function" title="psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>, are all listed in parameters, and are user-modifiable,
---
> <a class="reference internal" href="AutoAssociativeLearningMechanism.html#psyneulink.library.components.mechanisms.modulatory.learning.autoassociativelearningmechanism.AutoAssociativeLearningMechanism.output_ports" title="psyneulink.library.components.mechanisms.modulatory.learning.autoassociativelearningmechanism.AutoAssociativeLearningMechanism.output_ports"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_ports</span></code></a>, and <a class="reference internal" href="Mechanism.html#psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.function" title="psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a>, are all listed in parameters, and are user-modifiable,
522c522
< <li><p><strong>execute_until_finished</strong> – determines whether the Component executes until its <a class="reference internal" href="DDM.html#psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.is_finished" title="psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.is_finished"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">is_finished</span></code></a> method returns True.
---
> <li><p><strong>execute_until_finished</strong> – determines whether the Component executes until its <a class="reference internal" href="#psyneulink.core.components.component.Component.is_finished" title="psyneulink.core.components.component.Component.is_finished"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">is_finished</span></code></a> method returns True.
524,525c524,525
< irrespective of its <a class="reference internal" href="DDM.html#psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.is_finished" title="psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.is_finished"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">is_finished</span></code></a> method;  if it is True then, depending on how its class implements and handles its
< <a class="reference internal" href="DDM.html#psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.is_finished" title="psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.is_finished"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">is_finished</span></code></a> method, the Component may execute more than once per call to its <a class="reference internal" href="#psyneulink.core.components.component.Component.execute" title="psyneulink.core.components.component.Component.execute"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">execute</span></code></a> method.</p></li>
---
> irrespective of its <a class="reference internal" href="#psyneulink.core.components.component.Component.is_finished" title="psyneulink.core.components.component.Component.is_finished"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">is_finished</span></code></a> method;  if it is True then, depending on how its class implements and handles its
> <a class="reference internal" href="#psyneulink.core.components.component.Component.is_finished" title="psyneulink.core.components.component.Component.is_finished"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">is_finished</span></code></a> method, the Component may execute more than once per call to its <a class="reference internal" href="#psyneulink.core.components.component.Component.execute" title="psyneulink.core.components.component.Component.execute"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">execute</span></code></a> method.</p></li>
530c530
< <a class="reference internal" href="#psyneulink.core.components.component.Component.execute" title="psyneulink.core.components.component.Component.execute"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">execute</span></code></a> method, or extend over several calls.  It is set to 0 each time <a class="reference internal" href="DDM.html#psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.is_finished" title="psyneulink.library.components.mechanisms.processing.integrator.ddm.DDM.is_finished"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">is_finished</span></code></a> evaluates
---
> <a class="reference internal" href="#psyneulink.core.components.component.Component.execute" title="psyneulink.core.components.component.Component.execute"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">execute</span></code></a> method, or extend over several calls.  It is set to 0 each time <a class="reference internal" href="#psyneulink.core.components.component.Component.is_finished" title="psyneulink.core.components.component.Component.is_finished"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">is_finished</span></code></a> evaluates
764c764
< <dd class="field-odd"><p><a class="reference internal" href="CompositionInterfaceMechanism.html#psyneulink.core.components.mechanisms.processing.compositioninterfacemechanism.CompositionInterfaceMechanism.Parameters" title="psyneulink.core.components.mechanisms.processing.compositioninterfacemechanism.CompositionInterfaceMechanism.Parameters">Parameters</a></p>
---
> <dd class="field-odd"><p><a class="reference internal" href="AutodiffComposition.html#psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.Parameters" title="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.Parameters">Parameters</a></p>
diff -r docs-base/Composition.html docs-head/Composition.html
971c971
< the <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRoles</span></code></a> <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.TARGET" title="psyneulink.core.compositions.composition.NodeRole.TARGET"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">TARGET</span></code></a> and <a class="reference internal" href="Log.html#psyneulink.core.globals.log.LogCondition.LEARNING" title="psyneulink.core.globals.log.LogCondition.LEARNING"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">LEARNING</span></code></a> in the Composition.</p></li>
---
> the <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRoles</span></code></a> <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.TARGET" title="psyneulink.core.compositions.composition.NodeRole.TARGET"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">TARGET</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.LEARNING" title="psyneulink.core.compositions.composition.NodeRole.LEARNING"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">LEARNING</span></code></a> in the Composition.</p></li>
984c984
< – see below); this is assigned the <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRole</span></code></a> <a class="reference internal" href="Log.html#psyneulink.core.globals.log.LogCondition.LEARNING" title="psyneulink.core.globals.log.LogCondition.LEARNING"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">LEARNING</span></code></a
...

See CI logs for the full diff.

Copy link

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

diff -r docs-base/EMComposition.html docs-head/EMComposition.html
231c231
< <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-specification"><span class="std std-ref">Memory</span></a></p></li>
232a233
> <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
242c243
< <li><p><a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-structure"><span class="std std-ref">Memory</span></a></p></li>
251c252
< <li><p><a class="reference internal" href="#emcomposition-learning"><span class="std std-ref">Learning</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-training"><span class="std std-ref">Learning</span></a></p></li>
270c271
< <p>The EMComposition implements a configurable, content-addressable form of episodic, or eternal memory, that emulates
---
> <p>The EMComposition implements a configurable, content-addressable form of episodic (or external) memory. It emulates
272,280c273,291
< in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a> that is capable of learning how to differentially weight different cues used
< for retrieval,, and that adds the capability for <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. Its <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> is configured using two arguments of its constructor: <strong>memory_template</strong> argument, that defines
< how each 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> is structured (the number of fields in each entry and the length
< of each field); and <strong>field_weights</strong> argument, that defines which fields are used as cues for retrieval, i.e., “keys”,
< including whether and how they are differentially weighted in the match process used for retrieval); and which
< fields are treated as “values” that are stored retrieved, but not used by the match process. The inputs to an
< EMComposition, corresponding to each key (“query”) and value field are assigned to each of its <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> (listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_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</span></code></a> attributes, respectively), and the retrieved values are represented as <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition.  The <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> can be
< accessed using its <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> attribute.</p>
---
> in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a>. This allows it to backpropagate error signals based retrieved values to
> it inputs, and learn how to differentially weight cues (queries) used for retrieval. It also adds the capability for
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. In these respects, it implements a variant of a <a class="reference external" href="https://en.wikipedia.org/wiki/Modern_Hopfield_network">Modern Hopfield
> Network</a>, as well as some of the features of a <a class="reference external" href="https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)">Transformer</a></p>
> <p>The <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> of an EMComposition is configured using two arguments of its constructor:
> the <strong>memory_template</strong> argument, that defines the overall structure of its <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> (the
> number of fields in each entry, the length of each field, and the number of entries); and <strong>fields</strong> argument, that
> defines which fields are used as cues for retrieval (i.e., as “keys”), including whether and how they are weighted in
> the match process used for retrieval, which fields are treated as “values” that are stored retrieved but not used by
> the match process, and which are involved in learning. The inputs to an EMComposition, corresponding to its keys and
> values, are assigned to each of its <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>: inputs to be matched to keys
> (i.e., used as “queries”) are assigned to its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_input_nodes</span></code></a>; and the remaining
> inputs assigned to it <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</span></code></a>. When the EMComposition is executed, the
> retrieved values for all fields are returned as the result, and recorded in its <code class="xref any docutils literal notranslate"><span class="pre">results</span></code>
> attribute. The value for each field is assigned as the <a class="reference internal" href="OutputPort.html#psyneulink.core.components.ports.outputport.OutputPort.value" title="psyneulink.core.components.ports.outputport.OutputPort.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of its <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a>
> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a>. The input is then stored in its <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>, with a probability
> determined by its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_prob" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_prob"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_prob</span></code></a> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>, and all previous memories decayed by its
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay_rate</span></code></a>. The <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> can be accessed using its
> <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> Parameter.</p>
283,286c294,298
< <p>The memories of an EMComposition are actually stored in the <a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">matrix</span></a> attribute of a
< set of <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjections</span></a> (see <a class="reference internal" href="#emcomposition-memory-storage"><span class="std std-ref">note below</span></a>).  The <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> attribute compiles and formats these as a single 3d array, the rows of which (axis 0)
< are each entry, the columns of which (axis 1) are the fields of each entry, and the items of which (axis 2)
< are the values of each field (see <a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a> for additional details).</p>
---
> <p>The memories of an EMComposition are actually 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> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>
> of a set of <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjections</span></a> (see <a class="reference internal" href="#emcomposition-memory-storage"><span class="std std-ref">note below</span></a>). The
> <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> Parameter compiles and formats these as a single 3d array, the rows of which
> (axis 0) are each entry, the columns of which (axis 1) are the fields of each entry, and the items of which
> (axis 2)  are the values of each field (see <code class="xref any docutils literal notranslate"><span class="pre">EMComposition_Memory_Configuration</span></code> for additional details).</p>
293c305
< its own corresponding input (key or value) and output (retrieved value) <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Node</span></a> some or all of
---
> its own corresponding input (key or value) and output (retrieved value) <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Node</span></a>, some or all of
295,299c307,311
< Fields can be differentially weighted to determine the influence they have on retrieval, using the <a class="reference internal" href="MemoryFunctions.html#id0" title="psyneulink.core.components.functions.stateful.memoryfunctions.ContentAddressableMemory.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_weights</span></code></a> parameter (see <a class="reference internal" href="#emcomposition-retrieval-storage"><span class="std std-ref">retrieval</span></a> below). The number and
< shape of the fields in each entry is specified in the <strong>memory_template</strong> argument of the EMComposition’s constructor
< (see <a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">memory_template</span></a>). Which fields treated as keys (i.e., matched against queries during
< retrieval) and which are treated as values (i.e., retrieved but not used for matching retrieval) is specified in the
< <strong>field_weights</strong> argument of the EMComposition’s constructor (see <a class="reference internal" href="#emcomposition-field-weights"><span class="std std-ref">field_weights</span></a>).</p>
---
> Fields can be differentially weighted to determine the influence they have on retrieval, using the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.field_weights" title="psyneulink.library.compositions.emcomposition.EMComposition.field_weights"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_weights</span></code></a> parameter (see <a class="reference internal" href="#emcomposition-retrieval-storage"><span class="std std-ref">retrieval</span></a
...

See CI logs for the full diff.

Copy link

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

diff -r docs-base/EMComposition.html docs-head/EMComposition.html
231c231
< <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-specification"><span class="std std-ref">Memory</span></a></p></li>
232a233
> <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
242c243
< <li><p><a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-structure"><span class="std std-ref">Memory</span></a></p></li>
251c252
< <li><p><a class="reference internal" href="#emcomposition-learning"><span class="std std-ref">Learning</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-training"><span class="std std-ref">Learning</span></a></p></li>
270c271
< <p>The EMComposition implements a configurable, content-addressable form of episodic, or eternal memory, that emulates
---
> <p>The EMComposition implements a configurable, content-addressable form of episodic (or external) memory. It emulates
272,280c273,291
< in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a> that is capable of learning how to differentially weight different cues used
< for retrieval,, and that adds the capability for <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. Its <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> is configured using two arguments of its constructor: <strong>memory_template</strong> argument, that defines
< how each 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> is structured (the number of fields in each entry and the length
< of each field); and <strong>field_weights</strong> argument, that defines which fields are used as cues for retrieval, i.e., “keys”,
< including whether and how they are differentially weighted in the match process used for retrieval); and which
< fields are treated as “values” that are stored retrieved, but not used by the match process. The inputs to an
< EMComposition, corresponding to each key (“query”) and value field are assigned to each of its <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> (listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_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</span></code></a> attributes, respectively), and the retrieved values are represented as <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition.  The <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> can be
< accessed using its <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> attribute.</p>
---
> in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a>. This allows it to backpropagate error signals based retrieved values to
> it inputs, and learn how to differentially weight cues (queries) used for retrieval. It also adds the capability for
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. In these respects, it implements a variant of a <a class="reference external" href="https://en.wikipedia.org/wiki/Modern_Hopfield_network">Modern Hopfield
> Network</a>, as well as some of the features of a <a class="reference external" href="https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)">Transformer</a></p>
> <p>The <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> of an EMComposition is configured using two arguments of its constructor:
> the <strong>memory_template</strong> argument, that defines the overall structure of its <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> (the
> number of fields in each entry, the length of each field, and the number of entries); and <strong>fields</strong> argument, that
> defines which fields are used as cues for retrieval (i.e., as “keys”), including whether and how they are weighted in
> the match process used for retrieval, which fields are treated as “values” that are stored retrieved but not used by
> the match process, and which are involved in learning. The inputs to an EMComposition, corresponding to its keys and
> values, are assigned to each of its <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>: inputs to be matched to keys
> (i.e., used as “queries”) are assigned to its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_input_nodes</span></code></a>; and the remaining
> inputs assigned to it <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</span></code></a>. When the EMComposition is executed, the
> retrieved values for all fields are returned as the result, and recorded in its <code class="xref any docutils literal notranslate"><span class="pre">results</span></code>
> attribute. The value for each field is assigned as the <a class="reference internal" href="OutputPort.html#psyneulink.core.components.ports.outputport.OutputPort.value" title="psyneulink.core.components.ports.outputport.OutputPort.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of its <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a>
> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a>. The input is then stored in its <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>, with a probability
> determined by its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_prob" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_prob"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_prob</span></code></a> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>, and all previous memories decayed by its
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay_rate</span></code></a>. The <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> can be accessed using its
> <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> Parameter.</p>
283,286c294,298
< <p>The memories of an EMComposition are actually stored in the <a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">matrix</span></a> attribute of a
< set of <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjections</span></a> (see <a class="reference internal" href="#emcomposition-memory-storage"><span class="std std-ref">note below</span></a>).  The <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> attribute compiles and formats these as a single 3d array, the rows of which (axis 0)
< are each entry, the columns of which (axis 1) are the fields of each entry, and the items of which (axis 2)
< are the values of each field (see <a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a> for additional details).</p>
---
> <p>The memories of an EMComposition are actually 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> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>
> of a set of <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjections</span></a> (see <a class="reference internal" href="#emcomposition-memory-storage"><span class="std std-ref">note below</span></a>). The
> <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> Parameter compiles and formats these as a single 3d array, the rows of which
> (axis 0) are each entry, the columns of which (axis 1) are the fields of each entry, and the items of which
> (axis 2)  are the values of each field (see <code class="xref any docutils literal notranslate"><span class="pre">EMComposition_Memory_Configuration</span></code> for additional details).</p>
293c305
< its own corresponding input (key or value) and output (retrieved value) <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Node</span></a> some or all of
---
> its own corresponding input (key or value) and output (retrieved value) <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Node</span></a>, some or all of
295,299c307,311
< Fields can be differentially weighted to determine the influence they have on retrieval, using the <a class="reference internal" href="MemoryFunctions.html#id0" title="psyneulink.core.components.functions.stateful.memoryfunctions.ContentAddressableMemory.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_weights</span></code></a> parameter (see <a class="reference internal" href="#emcomposition-retrieval-storage"><span class="std std-ref">retrieval</span></a> below). The number and
< shape of the fields in each entry is specified in the <strong>memory_template</strong> argument of the EMComposition’s constructor
< (see <a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">memory_template</span></a>). Which fields treated as keys (i.e., matched against queries during
< retrieval) and which are treated as values (i.e., retrieved but not used for matching retrieval) is specified in the
< <strong>field_weights</strong> argument of the EMComposition’s constructor (see <a class="reference internal" href="#emcomposition-field-weights"><span class="std std-ref">field_weights</span></a>).</p>
---
> Fields can be differentially weighted to determine the influence they have on retrieval, using the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.field_weights" title="psyneulink.library.compositions.emcomposition.EMComposition.field_weights"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_weights</span></code></a> parameter (see <a class="reference internal" href="#emcomposition-retrieval-storage"><span class="std std-ref">retrieval</span></a
...

See CI logs for the full diff.

Copy link

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

diff -r docs-base/EMComposition.html docs-head/EMComposition.html
231c231
< <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-specification"><span class="std std-ref">Memory</span></a></p></li>
232a233
> <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
242c243
< <li><p><a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-structure"><span class="std std-ref">Memory</span></a></p></li>
251c252
< <li><p><a class="reference internal" href="#emcomposition-learning"><span class="std std-ref">Learning</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-training"><span class="std std-ref">Learning</span></a></p></li>
270c271
< <p>The EMComposition implements a configurable, content-addressable form of episodic, or eternal memory, that emulates
---
> <p>The EMComposition implements a configurable, content-addressable form of episodic (or external) memory. It emulates
272,280c273,291
< in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a> that is capable of learning how to differentially weight different cues used
< for retrieval,, and that adds the capability for <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. Its <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> is configured using two arguments of its constructor: <strong>memory_template</strong> argument, that defines
< how each 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> is structured (the number of fields in each entry and the length
< of each field); and <strong>field_weights</strong> argument, that defines which fields are used as cues for retrieval, i.e., “keys”,
< including whether and how they are differentially weighted in the match process used for retrieval); and which
< fields are treated as “values” that are stored retrieved, but not used by the match process. The inputs to an
< EMComposition, corresponding to each key (“query”) and value field are assigned to each of its <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> (listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_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</span></code></a> attributes, respectively), and the retrieved values are represented as <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition.  The <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> can be
< accessed using its <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> attribute.</p>
---
> in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a>. This allows it to backpropagate error signals based retrieved values to
> it inputs, and learn how to differentially weight cues (queries) used for retrieval. It also adds the capability for
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. In these respects, it implements a variant of a <a class="reference external" href="https://en.wikipedia.org/wiki/Modern_Hopfield_network">Modern Hopfield
> Network</a>, as well as some of the features of a <a class="reference external" href="https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)">Transformer</a></p>
> <p>The <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> of an EMComposition is configured using two arguments of its constructor:
> the <strong>memory_template</strong> argument, that defines the overall structure of its <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> (the
> number of fields in each entry, the length of each field, and the number of entries); and <strong>fields</strong> argument, that
> defines which fields are used as cues for retrieval (i.e., as “keys”), including whether and how they are weighted in
> the match process used for retrieval, which fields are treated as “values” that are stored retrieved but not used by
> the match process, and which are involved in learning. The inputs to an EMComposition, corresponding to its keys and
> values, are assigned to each of its <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>: inputs to be matched to keys
> (i.e., used as “queries”) are assigned to its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_input_nodes</span></code></a>; and the remaining
> inputs assigned to it <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</span></code></a>. When the EMComposition is executed, the
> retrieved values for all fields are returned as the result, and recorded in its <code class="xref any docutils literal notranslate"><span class="pre">results</span></code>
> attribute. The value for each field is assigned as the <a class="reference internal" href="OutputPort.html#psyneulink.core.components.ports.outputport.OutputPort.value" title="psyneulink.core.components.ports.outputport.OutputPort.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of its <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a>
> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a>. The input is then stored in its <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>, with a probability
> determined by its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_prob" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_prob"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_prob</span></code></a> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>, and all previous memories decayed by its
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay_rate</span></code></a>. The <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> can be accessed using its
> <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> Parameter.</p>
283,286c294,298
< <p>The memories of an EMComposition are actually stored in the <a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">matrix</span></a> attribute of a
< set of <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjections</span></a> (see <a class="reference internal" href="#emcomposition-memory-storage"><span class="std std-ref">note below</span></a>).  The <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> attribute compiles and formats these as a single 3d array, the rows of which (axis 0)
< are each entry, the columns of which (axis 1) are the fields of each entry, and the items of which (axis 2)
< are the values of each field (see <a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a> for additional details).</p>
---
> <p>The memories of an EMComposition are actually 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> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>
> of a set of <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjections</span></a> (see <a class="reference internal" href="#emcomposition-memory-storage"><span class="std std-ref">note below</span></a>). The
> <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> Parameter compiles and formats these as a single 3d array, the rows of which
> (axis 0) are each entry, the columns of which (axis 1) are the fields of each entry, and the items of which
> (axis 2)  are the values of each field (see <code class="xref any docutils literal notranslate"><span class="pre">EMComposition_Memory_Configuration</span></code> for additional details).</p>
293c305
< its own corresponding input (key or value) and output (retrieved value) <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Node</span></a> some or all of
---
> its own corresponding input (key or value) and output (retrieved value) <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Node</span></a>, some or all of
295,299c307,311
< Fields can be differentially weighted to determine the influence they have on retrieval, using the <a class="reference internal" href="MemoryFunctions.html#id0" title="psyneulink.core.components.functions.stateful.memoryfunctions.ContentAddressableMemory.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_weights</span></code></a> parameter (see <a class="reference internal" href="#emcomposition-retrieval-storage"><span class="std std-ref">retrieval</span></a> below). The number and
< shape of the fields in each entry is specified in the <strong>memory_template</strong> argument of the EMComposition’s constructor
< (see <a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">memory_template</span></a>). Which fields treated as keys (i.e., matched against queries during
< retrieval) and which are treated as values (i.e., retrieved but not used for matching retrieval) is specified in the
< <strong>field_weights</strong> argument of the EMComposition’s constructor (see <a class="reference internal" href="#emcomposition-field-weights"><span class="std std-ref">field_weights</span></a>).</p>
---
> Fields can be differentially weighted to determine the influence they have on retrieval, using the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.field_weights" title="psyneulink.library.compositions.emcomposition.EMComposition.field_weights"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_weights</span></code></a> parameter (see <a class="reference internal" href="#emcomposition-retrieval-storage"><span class="std std-ref">retrieval</span></a
...

See CI logs for the full diff.

  - add purge_by_field_weights Parameter
Copy link

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

diff -r docs-base/EMComposition.html docs-head/EMComposition.html
231c231
< <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-specification"><span class="std std-ref">Memory</span></a></p></li>
232a233
> <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
242c243
< <li><p><a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-structure"><span class="std std-ref">Memory</span></a></p></li>
251c252
< <li><p><a class="reference internal" href="#emcomposition-learning"><span class="std std-ref">Learning</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-training"><span class="std std-ref">Learning</span></a></p></li>
270c271
< <p>The EMComposition implements a configurable, content-addressable form of episodic, or eternal memory, that emulates
---
> <p>The EMComposition implements a configurable, content-addressable form of episodic (or external) memory. It emulates
272,280c273,291
< in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a> that is capable of learning how to differentially weight different cues used
< for retrieval,, and that adds the capability for <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. Its <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> is configured using two arguments of its constructor: <strong>memory_template</strong> argument, that defines
< how each 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> is structured (the number of fields in each entry and the length
< of each field); and <strong>field_weights</strong> argument, that defines which fields are used as cues for retrieval, i.e., “keys”,
< including whether and how they are differentially weighted in the match process used for retrieval); and which
< fields are treated as “values” that are stored retrieved, but not used by the match process. The inputs to an
< EMComposition, corresponding to each key (“query”) and value field are assigned to each of its <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> (listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_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</span></code></a> attributes, respectively), and the retrieved values are represented as <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition.  The <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> can be
< accessed using its <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> attribute.</p>
---
> in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a>. This allows it to backpropagate error signals based retrieved values to
> it inputs, and learn how to differentially weight cues (queries) used for retrieval. It also adds the capability for
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. In these respects, it implements a variant of a <a class="reference external" href="https://en.wikipedia.org/wiki/Modern_Hopfield_network">Modern Hopfield
> Network</a>, as well as some of the features of a <a class="reference external" href="https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)">Transformer</a></p>
> <p>The <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> of an EMComposition is configured using two arguments of its constructor:
> the <strong>memory_template</strong> argument, that defines the overall structure of its <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> (the
> number of fields in each entry, the length of each field, and the number of entries); and <strong>fields</strong> argument, that
> defines which fields are used as cues for retrieval (i.e., as “keys”), including whether and how they are weighted in
> the match process used for retrieval, which fields are treated as “values” that are stored retrieved but not used by
> the match process, and which are involved in learning. The inputs to an EMComposition, corresponding to its keys and
> values, are assigned to each of its <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>: inputs to be matched to keys
> (i.e., used as “queries”) are assigned to its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_input_nodes</span></code></a>; and the remaining
> inputs assigned to it <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</span></code></a>. When the EMComposition is executed, the
> retrieved values for all fields are returned as the result, and recorded in its <code class="xref any docutils literal notranslate"><span class="pre">results</span></code>
> attribute. The value for each field is assigned as the <a class="reference internal" href="OutputPort.html#psyneulink.core.components.ports.outputport.OutputPort.value" title="psyneulink.core.components.ports.outputport.OutputPort.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of its <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a>
> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a>. The input is then stored in its <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>, with a probability
> determined by its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_prob" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_prob"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_prob</span></code></a> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>, and all previous memories decayed by its
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay_rate</span></code></a>. The <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> can be accessed using its
> <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> Parameter.</p>
283,286c294,298
< <p>The memories of an EMComposition are actually stored in the <a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">matrix</span></a> attribute of a
< set of <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjections</span></a> (see <a class="reference internal" href="#emcomposition-memory-storage"><span class="std std-ref">note below</span></a>).  The <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> attribute compiles and formats these as a single 3d array, the rows of which (axis 0)
< are each entry, the columns of which (axis 1) are the fields of each entry, and the items of which (axis 2)
< are the values of each field (see <a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a> for additional details).</p>
---
> <p>The memories of an EMComposition are actually 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> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>
> of a set of <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjections</span></a> (see <a class="reference internal" href="#emcomposition-memory-storage"><span class="std std-ref">note below</span></a>). The
> <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> Parameter compiles and formats these as a single 3d array, the rows of which
> (axis 0) are each entry, the columns of which (axis 1) are the fields of each entry, and the items of which
> (axis 2)  are the values of each field (see <code class="xref any docutils literal notranslate"><span class="pre">EMComposition_Memory_Configuration</span></code> for additional details).</p>
293c305
< its own corresponding input (key or value) and output (retrieved value) <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Node</span></a> some or all of
---
> its own corresponding input (key or value) and output (retrieved value) <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Node</span></a>, some or all of
295,299c307,311
< Fields can be differentially weighted to determine the influence they have on retrieval, using the <a class="reference internal" href="MemoryFunctions.html#id0" title="psyneulink.core.components.functions.stateful.memoryfunctions.ContentAddressableMemory.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_weights</span></code></a> parameter (see <a class="reference internal" href="#emcomposition-retrieval-storage"><span class="std std-ref">retrieval</span></a> below). The number and
< shape of the fields in each entry is specified in the <strong>memory_template</strong> argument of the EMComposition’s constructor
< (see <a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">memory_template</span></a>). Which fields treated as keys (i.e., matched against queries during
< retrieval) and which are treated as values (i.e., retrieved but not used for matching retrieval) is specified in the
< <strong>field_weights</strong> argument of the EMComposition’s constructor (see <a class="reference internal" href="#emcomposition-field-weights"><span class="std std-ref">field_weights</span></a>).</p>
---
> Fields can be differentially weighted to determine the influence they have on retrieval, using the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.field_weights" title="psyneulink.library.compositions.emcomposition.EMComposition.field_weights"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_weights</span></code></a> parameter (see <a class="reference internal" href="#emcomposition-retrieval-storage"><span class="std std-ref">retrieval</span></a
...

See CI logs for the full diff.

Copy link

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

diff -r docs-base/EMComposition.html docs-head/EMComposition.html
231c231
< <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-specification"><span class="std std-ref">Memory</span></a></p></li>
232a233
> <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
242c243
< <li><p><a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-structure"><span class="std std-ref">Memory</span></a></p></li>
251c252
< <li><p><a class="reference internal" href="#emcomposition-learning"><span class="std std-ref">Learning</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-training"><span class="std std-ref">Learning</span></a></p></li>
270c271
< <p>The EMComposition implements a configurable, content-addressable form of episodic, or eternal memory, that emulates
---
> <p>The EMComposition implements a configurable, content-addressable form of episodic (or external) memory. It emulates
272,280c273,291
< in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a> that is capable of learning how to differentially weight different cues used
< for retrieval,, and that adds the capability for <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. Its <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> is configured using two arguments of its constructor: <strong>memory_template</strong> argument, that defines
< how each 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> is structured (the number of fields in each entry and the length
< of each field); and <strong>field_weights</strong> argument, that defines which fields are used as cues for retrieval, i.e., “keys”,
< including whether and how they are differentially weighted in the match process used for retrieval); and which
< fields are treated as “values” that are stored retrieved, but not used by the match process. The inputs to an
< EMComposition, corresponding to each key (“query”) and value field are assigned to each of its <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> (listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_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</span></code></a> attributes, respectively), and the retrieved values are represented as <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition.  The <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> can be
< accessed using its <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> attribute.</p>
---
> in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a>. This allows it to backpropagate error signals based retrieved values to
> it inputs, and learn how to differentially weight cues (queries) used for retrieval. It also adds the capability for
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. In these respects, it implements a variant of a <a class="reference external" href="https://en.wikipedia.org/wiki/Modern_Hopfield_network">Modern Hopfield
> Network</a>, as well as some of the features of a <a class="reference external" href="https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)">Transformer</a></p>
> <p>The <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> of an EMComposition is configured using two arguments of its constructor:
> the <strong>memory_template</strong> argument, that defines the overall structure of its <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> (the
> number of fields in each entry, the length of each field, and the number of entries); and <strong>fields</strong> argument, that
> defines which fields are used as cues for retrieval (i.e., as “keys”), including whether and how they are weighted in
> the match process used for retrieval, which fields are treated as “values” that are stored retrieved but not used by
> the match process, and which are involved in learning. The inputs to an EMComposition, corresponding to its keys and
> values, are assigned to each of its <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>: inputs to be matched to keys
> (i.e., used as “queries”) are assigned to its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_input_nodes</span></code></a>; and the remaining
> inputs assigned to it <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</span></code></a>. When the EMComposition is executed, the
> retrieved values for all fields are returned as the result, and recorded in its <code class="xref any docutils literal notranslate"><span class="pre">results</span></code>
> attribute. The value for each field is assigned as the <a class="reference internal" href="OutputPort.html#psyneulink.core.components.ports.outputport.OutputPort.value" title="psyneulink.core.components.ports.outputport.OutputPort.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of its <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a>
> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a>. The input is then stored in its <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>, with a probability
> determined by its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_prob" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_prob"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_prob</span></code></a> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>, and all previous memories decayed by its
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay_rate</span></code></a>. The <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> can be accessed using its
> <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> Parameter.</p>
283,286c294,298
< <p>The memories of an EMComposition are actually stored in the <a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">matrix</span></a> attribute of a
< set of <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjections</span></a> (see <a class="reference internal" href="#emcomposition-memory-storage"><span class="std std-ref">note below</span></a>).  The <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> attribute compiles and formats these as a single 3d array, the rows of which (axis 0)
< are each entry, the columns of which (axis 1) are the fields of each entry, and the items of which (axis 2)
< are the values of each field (see <a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a> for additional details).</p>
---
> <p>The memories of an EMComposition are actually 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> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>
> of a set of <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjections</span></a> (see <a class="reference internal" href="#emcomposition-memory-storage"><span class="std std-ref">note below</span></a>). The
> <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> Parameter compiles and formats these as a single 3d array, the rows of which
> (axis 0) are each entry, the columns of which (axis 1) are the fields of each entry, and the items of which
> (axis 2)  are the values of each field (see <code class="xref any docutils literal notranslate"><span class="pre">EMComposition_Memory_Configuration</span></code> for additional details).</p>
293c305
< its own corresponding input (key or value) and output (retrieved value) <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Node</span></a> some or all of
---
> its own corresponding input (key or value) and output (retrieved value) <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Node</span></a>, some or all of
295,299c307,311
< Fields can be differentially weighted to determine the influence they have on retrieval, using the <a class="reference internal" href="MemoryFunctions.html#id0" title="psyneulink.core.components.functions.stateful.memoryfunctions.ContentAddressableMemory.memory"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_weights</span></code></a> parameter (see <a class="reference internal" href="#emcomposition-retrieval-storage"><span class="std std-ref">retrieval</span></a> below). The number and
< shape of the fields in each entry is specified in the <strong>memory_template</strong> argument of the EMComposition’s constructor
< (see <a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">memory_template</span></a>). Which fields treated as keys (i.e., matched against queries during
< retrieval) and which are treated as values (i.e., retrieved but not used for matching retrieval) is specified in the
< <strong>field_weights</strong> argument of the EMComposition’s constructor (see <a class="reference internal" href="#emcomposition-field-weights"><span class="std std-ref">field_weights</span></a>).</p>
---
> Fields can be differentially weighted to determine the influence they have on retrieval, using the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.field_weights" title="psyneulink.library.compositions.emcomposition.EMComposition.field_weights"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">field_weights</span></code></a> parameter (see <a class="reference internal" href="#emcomposition-retrieval-storage"><span class="std std-ref">retrieval</span></a
...

See CI logs for the full diff.

  - infer_backpropagation_learning_pathways(): add NodeRole.BIAS to pathways consructed for learning
Copy link

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
288,291c288,296
< to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>. Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a
< TransferMechanism that projects to the relevant Mechanism (i.e., implementing that layer of the network to
< receive the biases) using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that
< implements a diagnoal matrix with values corresponding to the initial value of the biases.</p>
---
> to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>.</p>
> <blockquote>
> <div><p>Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a <a class="reference internal" href="ProcessingMechanism.html"><span class="doc">ProcessingMechanism</span></a>
> that projects to the relevant Mechanism (i.e., implementing that layer of the network to receive the biases)
> using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that implements a diagnoal
> matrix with values corresponding to the initial value of the biases, and setting the <a class="reference internal" href="InputPort.html#psyneulink.core.components.ports.inputport.InputPort.default_input" title="psyneulink.core.components.ports.inputport.InputPort.default_input"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">default_input</span></code></a> Parameter of one of the ProcessingMechanism’s <a class="reference internal" href="Mechanism.html#psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports" title="psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">input_ports</span></code></a> to <em>DEFAULT_VARIABLE</em>, and its <code class="xref any docutils literal notranslate"><span class="pre">default_variable</span></code>
> equal to 1. ProcessingMechanisms configured in this way are assigned <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRole</span></code></a> <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.BIAS" title="psyneulink.core.compositions.composition.NodeRole.BIAS"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">BIAS</span></code></a>, and the MappingProjection
> is subject to learning.</p>
> </div></blockquote>
diff -r docs-base/Composition.html docs-head/Composition.html
5706c5706
< input that is constant across executions).  Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
---
> input that is constant across executions). Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
diff -r docs-base/EMComposition.html docs-head/EMComposition.html
231c231
< <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-specification"><span class="std std-ref">Memory</span></a></p></li>
232a233
> <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
242c243
< <li><p><a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-structure"><span class="std std-ref">Memory</span></a></p></li>
251c252
< <li><p><a class="reference internal" href="#emcomposition-learning"><span class="std std-ref">Learning</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-training"><span class="std std-ref">Learning</span></a></p></li>
270c271
< <p>The EMComposition implements a configurable, content-addressable form of episodic, or eternal memory, that emulates
---
> <p>The EMComposition implements a configurable, content-addressable form of episodic (or external) memory. It emulates
272,280c273,291
< in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a> that is capable of learning how to differentially weight different cues used
< for retrieval,, and that adds the capability for <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. Its <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> is configured using two arguments of its constructor: <strong>memory_template</strong> argument, that defines
< how each 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> is structured (the number of fields in each entry and the length
< of each field); and <strong>field_weights</strong> argument, that defines which fields are used as cues for retrieval, i.e., “keys”,
< including whether and how they are differentially weighted in the match process used for retrieval); and which
< fields are treated as “values” that are stored retrieved, but not used by the match process. The inputs to an
< EMComposition, corresponding to each key (“query”) and value field are assigned to each of its <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> (listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_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</span></code></a> attributes, respectively), and the retrieved values are represented as <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition.  The <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> can be
< accessed using its <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> attribute.</p>
---
> in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a>. This allows it to backpropagate error signals based retrieved values to
> it inputs, and learn how to differentially weight cues (queries) used for retrieval. It also adds the capability for
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. In these respects, it implements a variant of a <a class="reference external" href="https://en.wikipedia.org/wiki/Modern_Hopfield_network">Modern Hopfield
> Network</a>, as well as some of the features of a <a class="reference external" href="https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)">Transformer</a></p>
> <p>The <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> of an EMComposition is configured using two arguments of its constructor:
> the <strong>memory_template</strong> argument, that defines the overall structure of its <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> (the
> number of fields in each entry, the length of each field, and the number of entries); and <strong>fields</strong> argument, that
> defines which fields are used as cues for retrieval (i.e., as “keys”), including whether and how they are weighted in
> the match process used for retrieval, which fields are treated as “values” that are stored retrieved but not used by
> the match process, and which are involved in learning. The inputs to an EMComposition, corresponding to its keys and
> values, are assigned to each of its <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>: inputs to be matched to keys
> (i.e., used as “queries”) are assigned to its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_input_nodes</span></code></a>; and the remaining
> inputs assigned to it <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</span></code></a>. When the EMComposition is executed, the
> retrieved values for all fields are returned as the result, and recorded in its <code class="xref any docutils literal notranslate"><span class="pre">results</span></code>
> attribute. The value for each field is assigned as the <a class="reference internal" href="OutputPort.html#psyneulink.core.components.ports.outputport.OutputPort.value" title="psyneulink.core.components.ports.outputport.OutputPort.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of its <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a>
> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a>. The input is then stored in its <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>, with a probability
> determined by its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_prob" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_prob"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_prob</span></code></a> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>, and all previous memories decayed by its
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay_rate</span></code></a>. The <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> can be accessed using its
> <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</sp
...

See CI logs for the full diff.

…Link into refactor/emcomposition_field_handling

# Conflicts:
#	tests/composition/test_emcomposition.py
Copy link

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
288,291c288,296
< to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>. Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a
< TransferMechanism that projects to the relevant Mechanism (i.e., implementing that layer of the network to
< receive the biases) using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that
< implements a diagnoal matrix with values corresponding to the initial value of the biases.</p>
---
> to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>.</p>
> <blockquote>
> <div><p>Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a <a class="reference internal" href="ProcessingMechanism.html"><span class="doc">ProcessingMechanism</span></a>
> that projects to the relevant Mechanism (i.e., implementing that layer of the network to receive the biases)
> using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that implements a diagnoal
> matrix with values corresponding to the initial value of the biases, and setting the <a class="reference internal" href="InputPort.html#psyneulink.core.components.ports.inputport.InputPort.default_input" title="psyneulink.core.components.ports.inputport.InputPort.default_input"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">default_input</span></code></a> Parameter of one of the ProcessingMechanism’s <a class="reference internal" href="Mechanism.html#psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports" title="psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">input_ports</span></code></a> to <em>DEFAULT_VARIABLE</em>, and its <code class="xref any docutils literal notranslate"><span class="pre">default_variable</span></code>
> equal to 1. ProcessingMechanisms configured in this way are assigned <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRole</span></code></a> <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.BIAS" title="psyneulink.core.compositions.composition.NodeRole.BIAS"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">BIAS</span></code></a>, and the MappingProjection
> is subject to learning.</p>
> </div></blockquote>
diff -r docs-base/Composition.html docs-head/Composition.html
5706c5706
< input that is constant across executions).  Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
---
> input that is constant across executions). Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
diff -r docs-base/EMComposition.html docs-head/EMComposition.html
231c231
< <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-specification"><span class="std std-ref">Memory</span></a></p></li>
232a233
> <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
242c243
< <li><p><a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-structure"><span class="std std-ref">Memory</span></a></p></li>
251c252
< <li><p><a class="reference internal" href="#emcomposition-learning"><span class="std std-ref">Learning</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-training"><span class="std std-ref">Learning</span></a></p></li>
270c271
< <p>The EMComposition implements a configurable, content-addressable form of episodic, or eternal memory, that emulates
---
> <p>The EMComposition implements a configurable, content-addressable form of episodic (or external) memory. It emulates
272,280c273,291
< in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a> that is capable of learning how to differentially weight different cues used
< for retrieval,, and that adds the capability for <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. Its <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> is configured using two arguments of its constructor: <strong>memory_template</strong> argument, that defines
< how each 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> is structured (the number of fields in each entry and the length
< of each field); and <strong>field_weights</strong> argument, that defines which fields are used as cues for retrieval, i.e., “keys”,
< including whether and how they are differentially weighted in the match process used for retrieval); and which
< fields are treated as “values” that are stored retrieved, but not used by the match process. The inputs to an
< EMComposition, corresponding to each key (“query”) and value field are assigned to each of its <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> (listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_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</span></code></a> attributes, respectively), and the retrieved values are represented as <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition.  The <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> can be
< accessed using its <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> attribute.</p>
---
> in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a>. This allows it to backpropagate error signals based retrieved values to
> it inputs, and learn how to differentially weight cues (queries) used for retrieval. It also adds the capability for
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. In these respects, it implements a variant of a <a class="reference external" href="https://en.wikipedia.org/wiki/Modern_Hopfield_network">Modern Hopfield
> Network</a>, as well as some of the features of a <a class="reference external" href="https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)">Transformer</a></p>
> <p>The <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> of an EMComposition is configured using two arguments of its constructor:
> the <strong>memory_template</strong> argument, that defines the overall structure of its <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> (the
> number of fields in each entry, the length of each field, and the number of entries); and <strong>fields</strong> argument, that
> defines which fields are used as cues for retrieval (i.e., as “keys”), including whether and how they are weighted in
> the match process used for retrieval, which fields are treated as “values” that are stored retrieved but not used by
> the match process, and which are involved in learning. The inputs to an EMComposition, corresponding to its keys and
> values, are assigned to each of its <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>: inputs to be matched to keys
> (i.e., used as “queries”) are assigned to its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_input_nodes</span></code></a>; and the remaining
> inputs assigned to it <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</span></code></a>. When the EMComposition is executed, the
> retrieved values for all fields are returned as the result, and recorded in its <code class="xref any docutils literal notranslate"><span class="pre">results</span></code>
> attribute. The value for each field is assigned as the <a class="reference internal" href="OutputPort.html#psyneulink.core.components.ports.outputport.OutputPort.value" title="psyneulink.core.components.ports.outputport.OutputPort.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of its <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a>
> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a>. The input is then stored in its <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>, with a probability
> determined by its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_prob" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_prob"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_prob</span></code></a> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>, and all previous memories decayed by its
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay_rate</span></code></a>. The <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> can be accessed using its
> <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</sp
...

See CI logs for the full diff.

Copy link

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
288,291c288,296
< to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>. Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a
< TransferMechanism that projects to the relevant Mechanism (i.e., implementing that layer of the network to
< receive the biases) using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that
< implements a diagnoal matrix with values corresponding to the initial value of the biases.</p>
---
> to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>.</p>
> <blockquote>
> <div><p>Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a <a class="reference internal" href="ProcessingMechanism.html"><span class="doc">ProcessingMechanism</span></a>
> that projects to the relevant Mechanism (i.e., implementing that layer of the network to receive the biases)
> using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that implements a diagnoal
> matrix with values corresponding to the initial value of the biases, and setting the <a class="reference internal" href="InputPort.html#psyneulink.core.components.ports.inputport.InputPort.default_input" title="psyneulink.core.components.ports.inputport.InputPort.default_input"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">default_input</span></code></a> Parameter of one of the ProcessingMechanism’s <a class="reference internal" href="Mechanism.html#psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports" title="psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">input_ports</span></code></a> to <em>DEFAULT_VARIABLE</em>, and its <code class="xref any docutils literal notranslate"><span class="pre">default_variable</span></code>
> equal to 1. ProcessingMechanisms configured in this way are assigned <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRole</span></code></a> <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.BIAS" title="psyneulink.core.compositions.composition.NodeRole.BIAS"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">BIAS</span></code></a>, and the MappingProjection
> is subject to learning.</p>
> </div></blockquote>
diff -r docs-base/Composition.html docs-head/Composition.html
5706c5706
< input that is constant across executions).  Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
---
> input that is constant across executions). Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
diff -r docs-base/EMComposition.html docs-head/EMComposition.html
231c231
< <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-specification"><span class="std std-ref">Memory</span></a></p></li>
232a233
> <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
242c243
< <li><p><a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-structure"><span class="std std-ref">Memory</span></a></p></li>
251c252
< <li><p><a class="reference internal" href="#emcomposition-learning"><span class="std std-ref">Learning</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-training"><span class="std std-ref">Learning</span></a></p></li>
270c271
< <p>The EMComposition implements a configurable, content-addressable form of episodic, or eternal memory, that emulates
---
> <p>The EMComposition implements a configurable, content-addressable form of episodic (or external) memory. It emulates
272,280c273,291
< in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a> that is capable of learning how to differentially weight different cues used
< for retrieval,, and that adds the capability for <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. Its <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> is configured using two arguments of its constructor: <strong>memory_template</strong> argument, that defines
< how each 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> is structured (the number of fields in each entry and the length
< of each field); and <strong>field_weights</strong> argument, that defines which fields are used as cues for retrieval, i.e., “keys”,
< including whether and how they are differentially weighted in the match process used for retrieval); and which
< fields are treated as “values” that are stored retrieved, but not used by the match process. The inputs to an
< EMComposition, corresponding to each key (“query”) and value field are assigned to each of its <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> (listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_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</span></code></a> attributes, respectively), and the retrieved values are represented as <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition.  The <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> can be
< accessed using its <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> attribute.</p>
---
> in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a>. This allows it to backpropagate error signals based retrieved values to
> it inputs, and learn how to differentially weight cues (queries) used for retrieval. It also adds the capability for
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. In these respects, it implements a variant of a <a class="reference external" href="https://en.wikipedia.org/wiki/Modern_Hopfield_network">Modern Hopfield
> Network</a>, as well as some of the features of a <a class="reference external" href="https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)">Transformer</a></p>
> <p>The <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> of an EMComposition is configured using two arguments of its constructor:
> the <strong>memory_template</strong> argument, that defines the overall structure of its <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> (the
> number of fields in each entry, the length of each field, and the number of entries); and <strong>fields</strong> argument, that
> defines which fields are used as cues for retrieval (i.e., as “keys”), including whether and how they are weighted in
> the match process used for retrieval, which fields are treated as “values” that are stored retrieved but not used by
> the match process, and which are involved in learning. The inputs to an EMComposition, corresponding to its keys and
> values, are assigned to each of its <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>: inputs to be matched to keys
> (i.e., used as “queries”) are assigned to its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_input_nodes</span></code></a>; and the remaining
> inputs assigned to it <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</span></code></a>. When the EMComposition is executed, the
> retrieved values for all fields are returned as the result, and recorded in its <code class="xref any docutils literal notranslate"><span class="pre">results</span></code>
> attribute. The value for each field is assigned as the <a class="reference internal" href="OutputPort.html#psyneulink.core.components.ports.outputport.OutputPort.value" title="psyneulink.core.components.ports.outputport.OutputPort.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of its <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a>
> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a>. The input is then stored in its <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>, with a probability
> determined by its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_prob" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_prob"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_prob</span></code></a> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>, and all previous memories decayed by its
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay_rate</span></code></a>. The <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> can be accessed using its
> <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</sp
...

See CI logs for the full diff.

Copy link

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
288,291c288,296
< to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>. Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a
< TransferMechanism that projects to the relevant Mechanism (i.e., implementing that layer of the network to
< receive the biases) using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that
< implements a diagnoal matrix with values corresponding to the initial value of the biases.</p>
---
> to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>.</p>
> <blockquote>
> <div><p>Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a <a class="reference internal" href="ProcessingMechanism.html"><span class="doc">ProcessingMechanism</span></a>
> that projects to the relevant Mechanism (i.e., implementing that layer of the network to receive the biases)
> using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that implements a diagnoal
> matrix with values corresponding to the initial value of the biases, and setting the <a class="reference internal" href="InputPort.html#psyneulink.core.components.ports.inputport.InputPort.default_input" title="psyneulink.core.components.ports.inputport.InputPort.default_input"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">default_input</span></code></a> Parameter of one of the ProcessingMechanism’s <a class="reference internal" href="Mechanism.html#psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports" title="psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">input_ports</span></code></a> to <em>DEFAULT_VARIABLE</em>, and its <code class="xref any docutils literal notranslate"><span class="pre">default_variable</span></code>
> equal to 1. ProcessingMechanisms configured in this way are assigned <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRole</span></code></a> <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.BIAS" title="psyneulink.core.compositions.composition.NodeRole.BIAS"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">BIAS</span></code></a>, and the MappingProjection
> is subject to learning.</p>
> </div></blockquote>
diff -r docs-base/Composition.html docs-head/Composition.html
5706c5706
< input that is constant across executions).  Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
---
> input that is constant across executions). Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
diff -r docs-base/EMComposition.html docs-head/EMComposition.html
231c231
< <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-specification"><span class="std std-ref">Memory</span></a></p></li>
232a233
> <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
242c243
< <li><p><a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-structure"><span class="std std-ref">Memory</span></a></p></li>
251c252
< <li><p><a class="reference internal" href="#emcomposition-learning"><span class="std std-ref">Learning</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-training"><span class="std std-ref">Learning</span></a></p></li>
270c271
< <p>The EMComposition implements a configurable, content-addressable form of episodic, or eternal memory, that emulates
---
> <p>The EMComposition implements a configurable, content-addressable form of episodic (or external) memory. It emulates
272,280c273,291
< in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a> that is capable of learning how to differentially weight different cues used
< for retrieval,, and that adds the capability for <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. Its <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> is configured using two arguments of its constructor: <strong>memory_template</strong> argument, that defines
< how each 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> is structured (the number of fields in each entry and the length
< of each field); and <strong>field_weights</strong> argument, that defines which fields are used as cues for retrieval, i.e., “keys”,
< including whether and how they are differentially weighted in the match process used for retrieval); and which
< fields are treated as “values” that are stored retrieved, but not used by the match process. The inputs to an
< EMComposition, corresponding to each key (“query”) and value field are assigned to each of its <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> (listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_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</span></code></a> attributes, respectively), and the retrieved values are represented as <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition.  The <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> can be
< accessed using its <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> attribute.</p>
---
> in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a>. This allows it to backpropagate error signals based retrieved values to
> it inputs, and learn how to differentially weight cues (queries) used for retrieval. It also adds the capability for
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. In these respects, it implements a variant of a <a class="reference external" href="https://en.wikipedia.org/wiki/Modern_Hopfield_network">Modern Hopfield
> Network</a>, as well as some of the features of a <a class="reference external" href="https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)">Transformer</a></p>
> <p>The <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> of an EMComposition is configured using two arguments of its constructor:
> the <strong>memory_template</strong> argument, that defines the overall structure of its <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> (the
> number of fields in each entry, the length of each field, and the number of entries); and <strong>fields</strong> argument, that
> defines which fields are used as cues for retrieval (i.e., as “keys”), including whether and how they are weighted in
> the match process used for retrieval, which fields are treated as “values” that are stored retrieved but not used by
> the match process, and which are involved in learning. The inputs to an EMComposition, corresponding to its keys and
> values, are assigned to each of its <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>: inputs to be matched to keys
> (i.e., used as “queries”) are assigned to its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_input_nodes</span></code></a>; and the remaining
> inputs assigned to it <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</span></code></a>. When the EMComposition is executed, the
> retrieved values for all fields are returned as the result, and recorded in its <code class="xref any docutils literal notranslate"><span class="pre">results</span></code>
> attribute. The value for each field is assigned as the <a class="reference internal" href="OutputPort.html#psyneulink.core.components.ports.outputport.OutputPort.value" title="psyneulink.core.components.ports.outputport.OutputPort.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of its <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a>
> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a>. The input is then stored in its <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>, with a probability
> determined by its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_prob" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_prob"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_prob</span></code></a> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>, and all previous memories decayed by its
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay_rate</span></code></a>. The <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> can be accessed using its
> <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</sp
...

See CI logs for the full diff.

Copy link

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
288,291c288,296
< to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>. Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a
< TransferMechanism that projects to the relevant Mechanism (i.e., implementing that layer of the network to
< receive the biases) using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that
< implements a diagnoal matrix with values corresponding to the initial value of the biases.</p>
---
> to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>.</p>
> <blockquote>
> <div><p>Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a <a class="reference internal" href="ProcessingMechanism.html"><span class="doc">ProcessingMechanism</span></a>
> that projects to the relevant Mechanism (i.e., implementing that layer of the network to receive the biases)
> using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that implements a diagnoal
> matrix with values corresponding to the initial value of the biases, and setting the <a class="reference internal" href="InputPort.html#psyneulink.core.components.ports.inputport.InputPort.default_input" title="psyneulink.core.components.ports.inputport.InputPort.default_input"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">default_input</span></code></a> Parameter of one of the ProcessingMechanism’s <a class="reference internal" href="Mechanism.html#psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports" title="psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">input_ports</span></code></a> to <em>DEFAULT_VARIABLE</em>, and its <code class="xref any docutils literal notranslate"><span class="pre">default_variable</span></code>
> equal to 1. ProcessingMechanisms configured in this way are assigned <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRole</span></code></a> <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.BIAS" title="psyneulink.core.compositions.composition.NodeRole.BIAS"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">BIAS</span></code></a>, and the MappingProjection
> is subject to learning.</p>
> </div></blockquote>
diff -r docs-base/Composition.html docs-head/Composition.html
5706c5706
< input that is constant across executions).  Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
---
> input that is constant across executions). Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
diff -r docs-base/EMComposition.html docs-head/EMComposition.html
231c231
< <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-specification"><span class="std std-ref">Memory</span></a></p></li>
232a233
> <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
242c243
< <li><p><a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-structure"><span class="std std-ref">Memory</span></a></p></li>
251c252
< <li><p><a class="reference internal" href="#emcomposition-learning"><span class="std std-ref">Learning</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-training"><span class="std std-ref">Learning</span></a></p></li>
270c271
< <p>The EMComposition implements a configurable, content-addressable form of episodic, or eternal memory, that emulates
---
> <p>The EMComposition implements a configurable, content-addressable form of episodic (or external) memory. It emulates
272,280c273,291
< in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a> that is capable of learning how to differentially weight different cues used
< for retrieval,, and that adds the capability for <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. Its <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> is configured using two arguments of its constructor: <strong>memory_template</strong> argument, that defines
< how each 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> is structured (the number of fields in each entry and the length
< of each field); and <strong>field_weights</strong> argument, that defines which fields are used as cues for retrieval, i.e., “keys”,
< including whether and how they are differentially weighted in the match process used for retrieval); and which
< fields are treated as “values” that are stored retrieved, but not used by the match process. The inputs to an
< EMComposition, corresponding to each key (“query”) and value field are assigned to each of its <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> (listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_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</span></code></a> attributes, respectively), and the retrieved values are represented as <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition.  The <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> can be
< accessed using its <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> attribute.</p>
---
> in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a>. This allows it to backpropagate error signals based retrieved values to
> it inputs, and learn how to differentially weight cues (queries) used for retrieval. It also adds the capability for
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. In these respects, it implements a variant of a <a class="reference external" href="https://en.wikipedia.org/wiki/Modern_Hopfield_network">Modern Hopfield
> Network</a>, as well as some of the features of a <a class="reference external" href="https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)">Transformer</a></p>
> <p>The <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> of an EMComposition is configured using two arguments of its constructor:
> the <strong>memory_template</strong> argument, that defines the overall structure of its <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> (the
> number of fields in each entry, the length of each field, and the number of entries); and <strong>fields</strong> argument, that
> defines which fields are used as cues for retrieval (i.e., as “keys”), including whether and how they are weighted in
> the match process used for retrieval, which fields are treated as “values” that are stored retrieved but not used by
> the match process, and which are involved in learning. The inputs to an EMComposition, corresponding to its keys and
> values, are assigned to each of its <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>: inputs to be matched to keys
> (i.e., used as “queries”) are assigned to its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_input_nodes</span></code></a>; and the remaining
> inputs assigned to it <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</span></code></a>. When the EMComposition is executed, the
> retrieved values for all fields are returned as the result, and recorded in its <code class="xref any docutils literal notranslate"><span class="pre">results</span></code>
> attribute. The value for each field is assigned as the <a class="reference internal" href="OutputPort.html#psyneulink.core.components.ports.outputport.OutputPort.value" title="psyneulink.core.components.ports.outputport.OutputPort.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of its <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a>
> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a>. The input is then stored in its <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>, with a probability
> determined by its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_prob" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_prob"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_prob</span></code></a> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>, and all previous memories decayed by its
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay_rate</span></code></a>. The <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> can be accessed using its
> <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</sp
...

See CI logs for the full diff.

Copy link

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
288,291c288,296
< to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>. Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a
< TransferMechanism that projects to the relevant Mechanism (i.e., implementing that layer of the network to
< receive the biases) using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that
< implements a diagnoal matrix with values corresponding to the initial value of the biases.</p>
---
> to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>.</p>
> <blockquote>
> <div><p>Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a <a class="reference internal" href="ProcessingMechanism.html"><span class="doc">ProcessingMechanism</span></a>
> that projects to the relevant Mechanism (i.e., implementing that layer of the network to receive the biases)
> using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that implements a diagnoal
> matrix with values corresponding to the initial value of the biases, and setting the <a class="reference internal" href="InputPort.html#psyneulink.core.components.ports.inputport.InputPort.default_input" title="psyneulink.core.components.ports.inputport.InputPort.default_input"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">default_input</span></code></a> Parameter of one of the ProcessingMechanism’s <a class="reference internal" href="Mechanism.html#psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports" title="psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">input_ports</span></code></a> to <em>DEFAULT_VARIABLE</em>, and its <code class="xref any docutils literal notranslate"><span class="pre">default_variable</span></code>
> equal to 1. ProcessingMechanisms configured in this way are assigned <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRole</span></code></a> <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.BIAS" title="psyneulink.core.compositions.composition.NodeRole.BIAS"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">BIAS</span></code></a>, and the MappingProjection
> is subject to learning.</p>
> </div></blockquote>
diff -r docs-base/Composition.html docs-head/Composition.html
5706c5706
< input that is constant across executions).  Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
---
> input that is constant across executions). Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
diff -r docs-base/EMComposition.html docs-head/EMComposition.html
231c231
< <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-specification"><span class="std std-ref">Memory</span></a></p></li>
232a233
> <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
242c243
< <li><p><a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-structure"><span class="std std-ref">Memory</span></a></p></li>
251c252
< <li><p><a class="reference internal" href="#emcomposition-learning"><span class="std std-ref">Learning</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-training"><span class="std std-ref">Learning</span></a></p></li>
270c271
< <p>The EMComposition implements a configurable, content-addressable form of episodic, or eternal memory, that emulates
---
> <p>The EMComposition implements a configurable, content-addressable form of episodic (or external) memory. It emulates
272,280c273,291
< in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a> that is capable of learning how to differentially weight different cues used
< for retrieval,, and that adds the capability for <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. Its <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> is configured using two arguments of its constructor: <strong>memory_template</strong> argument, that defines
< how each 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> is structured (the number of fields in each entry and the length
< of each field); and <strong>field_weights</strong> argument, that defines which fields are used as cues for retrieval, i.e., “keys”,
< including whether and how they are differentially weighted in the match process used for retrieval); and which
< fields are treated as “values” that are stored retrieved, but not used by the match process. The inputs to an
< EMComposition, corresponding to each key (“query”) and value field are assigned to each of its <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> (listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_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</span></code></a> attributes, respectively), and the retrieved values are represented as <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition.  The <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> can be
< accessed using its <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> attribute.</p>
---
> in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a>. This allows it to backpropagate error signals based retrieved values to
> it inputs, and learn how to differentially weight cues (queries) used for retrieval. It also adds the capability for
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. In these respects, it implements a variant of a <a class="reference external" href="https://en.wikipedia.org/wiki/Modern_Hopfield_network">Modern Hopfield
> Network</a>, as well as some of the features of a <a class="reference external" href="https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)">Transformer</a></p>
> <p>The <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> of an EMComposition is configured using two arguments of its constructor:
> the <strong>memory_template</strong> argument, that defines the overall structure of its <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> (the
> number of fields in each entry, the length of each field, and the number of entries); and <strong>fields</strong> argument, that
> defines which fields are used as cues for retrieval (i.e., as “keys”), including whether and how they are weighted in
> the match process used for retrieval, which fields are treated as “values” that are stored retrieved but not used by
> the match process, and which are involved in learning. The inputs to an EMComposition, corresponding to its keys and
> values, are assigned to each of its <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>: inputs to be matched to keys
> (i.e., used as “queries”) are assigned to its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_input_nodes</span></code></a>; and the remaining
> inputs assigned to it <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</span></code></a>. When the EMComposition is executed, the
> retrieved values for all fields are returned as the result, and recorded in its <code class="xref any docutils literal notranslate"><span class="pre">results</span></code>
> attribute. The value for each field is assigned as the <a class="reference internal" href="OutputPort.html#psyneulink.core.components.ports.outputport.OutputPort.value" title="psyneulink.core.components.ports.outputport.OutputPort.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of its <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a>
> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a>. The input is then stored in its <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>, with a probability
> determined by its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_prob" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_prob"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_prob</span></code></a> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>, and all previous memories decayed by its
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay_rate</span></code></a>. The <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> can be accessed using its
> <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</sp
...

See CI logs for the full diff.

Copy link

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
288,291c288,296
< to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>. Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a
< TransferMechanism that projects to the relevant Mechanism (i.e., implementing that layer of the network to
< receive the biases) using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that
< implements a diagnoal matrix with values corresponding to the initial value of the biases.</p>
---
> to <code class="xref any docutils literal notranslate"><span class="pre">False</span></code>.</p>
> <blockquote>
> <div><p>Trainable biases <em>can</em> be specified explicitly in an AutodiffComposition by including a <a class="reference internal" href="ProcessingMechanism.html"><span class="doc">ProcessingMechanism</span></a>
> that projects to the relevant Mechanism (i.e., implementing that layer of the network to receive the biases)
> using a <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></a> with a <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 that implements a diagnoal
> matrix with values corresponding to the initial value of the biases, and setting the <a class="reference internal" href="InputPort.html#psyneulink.core.components.ports.inputport.InputPort.default_input" title="psyneulink.core.components.ports.inputport.InputPort.default_input"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">default_input</span></code></a> Parameter of one of the ProcessingMechanism’s <a class="reference internal" href="Mechanism.html#psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports" title="psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.input_ports"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">input_ports</span></code></a> to <em>DEFAULT_VARIABLE</em>, and its <code class="xref any docutils literal notranslate"><span class="pre">default_variable</span></code>
> equal to 1. ProcessingMechanisms configured in this way are assigned <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole" title="psyneulink.core.compositions.composition.NodeRole"><code class="xref any py py-class docutils literal notranslate"><span class="pre">NodeRole</span></code></a> <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.BIAS" title="psyneulink.core.compositions.composition.NodeRole.BIAS"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">BIAS</span></code></a>, and the MappingProjection
> is subject to learning.</p>
> </div></blockquote>
diff -r docs-base/Composition.html docs-head/Composition.html
5706c5706
< input that is constant across executions).  Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
---
> input that is constant across executions). Such a node can also be assigned as an <a class="reference internal" href="#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> and/or <a class="reference internal" href="#psyneulink.core.compositions.composition.NodeRole.ORIGIN" title="psyneulink.core.compositions.composition.NodeRole.ORIGIN"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">ORIGIN</span></code></a>,
diff -r docs-base/EMComposition.html docs-head/EMComposition.html
231c231
< <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-specification"><span class="std std-ref">Memory</span></a></p></li>
232a233
> <li><p><a class="reference internal" href="#emcomposition-fields"><span class="std std-ref">Fields</span></a></p></li>
242c243
< <li><p><a class="reference internal" href="#emcomposition-memory"><span class="std std-ref">Memory</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-memory-structure"><span class="std std-ref">Memory</span></a></p></li>
251c252
< <li><p><a class="reference internal" href="#emcomposition-learning"><span class="std std-ref">Learning</span></a></p></li>
---
> <li><p><a class="reference internal" href="#emcomposition-training"><span class="std std-ref">Learning</span></a></p></li>
270c271
< <p>The EMComposition implements a configurable, content-addressable form of episodic, or eternal memory, that emulates
---
> <p>The EMComposition implements a configurable, content-addressable form of episodic (or external) memory. It emulates
272,280c273,291
< in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a> that is capable of learning how to differentially weight different cues used
< for retrieval,, and that adds the capability for <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. Its <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> is configured using two arguments of its constructor: <strong>memory_template</strong> argument, that defines
< how each 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> is structured (the number of fields in each entry and the length
< of each field); and <strong>field_weights</strong> argument, that defines which fields are used as cues for retrieval, i.e., “keys”,
< including whether and how they are differentially weighted in the match process used for retrieval); and which
< fields are treated as “values” that are stored retrieved, but not used by the match process. The inputs to an
< EMComposition, corresponding to each key (“query”) and value field are assigned to each of its <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> (listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_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</span></code></a> attributes, respectively), and the retrieved values are represented as <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition.  The <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> can be
< accessed using its <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> attribute.</p>
---
> in the form of an <a class="reference internal" href="AutodiffComposition.html"><span class="doc">AutodiffComposition</span></a>. This allows it to backpropagate error signals based retrieved values to
> it inputs, and learn how to differentially weight cues (queries) used for retrieval. It also adds the capability for
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay</span></code></a>. In these respects, it implements a variant of a <a class="reference external" href="https://en.wikipedia.org/wiki/Modern_Hopfield_network">Modern Hopfield
> Network</a>, as well as some of the features of a <a class="reference external" href="https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)">Transformer</a></p>
> <p>The <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> of an EMComposition is configured using two arguments of its constructor:
> the <strong>memory_template</strong> argument, that defines the overall structure of its <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> (the
> number of fields in each entry, the length of each field, and the number of entries); and <strong>fields</strong> argument, that
> defines which fields are used as cues for retrieval (i.e., as “keys”), including whether and how they are weighted in
> the match process used for retrieval, which fields are treated as “values” that are stored retrieved but not used by
> the match process, and which are involved in learning. The inputs to an EMComposition, corresponding to its keys and
> values, are assigned to each of its <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>: inputs to be matched to keys
> (i.e., used as “queries”) are assigned to its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.query_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">query_input_nodes</span></code></a>; and the remaining
> inputs assigned to it <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</span></code></a>. When the EMComposition is executed, the
> retrieved values for all fields are returned as the result, and recorded in its <code class="xref any docutils literal notranslate"><span class="pre">results</span></code>
> attribute. The value for each field is assigned as the <a class="reference internal" href="OutputPort.html#psyneulink.core.components.ports.outputport.OutputPort.value" title="psyneulink.core.components.ports.outputport.OutputPort.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of its <a class="reference internal" href="Composition.html#psyneulink.core.compositions.composition.NodeRole.OUTPUT" title="psyneulink.core.compositions.composition.NodeRole.OUTPUT"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">OUTPUT</span></code></a>
> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a>. The input is then stored in its <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>, with a probability
> determined by its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.storage_prob" title="psyneulink.library.compositions.emcomposition.EMComposition.storage_prob"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">storage_prob</span></code></a> <a class="reference internal" href="Parameters.html#psyneulink.core.globals.parameters.Parameter" title="psyneulink.core.globals.parameters.Parameter"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Parameter</span></code></a>, and all previous memories decayed by its
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate" title="psyneulink.library.compositions.emcomposition.EMComposition.memory_decay_rate"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">memory_decay_rate</span></code></a>. The <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> can be accessed using its
> <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</sp
...

See CI logs for the full diff.

@jdcpni jdcpni merged commit ad1e743 into devel Nov 22, 2024
71 checks passed
@jdcpni jdcpni deleted the refactor/emcomposition_field_handling branch November 22, 2024 12:39
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