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

Devel #2751

Merged
merged 8 commits into from
Aug 1, 2023
Merged

Devel #2751

merged 8 commits into from
Aug 1, 2023

Conversation

kmantel
Copy link
Collaborator

@kmantel kmantel commented Jul 27, 2023

No description provided.

@kmantel kmantel changed the base branch from devel to master July 27, 2023 03:19
@kmantel kmantel closed this Jul 27, 2023
@github-actions
Copy link

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

No differences!

...

See CI logs for the full diff.

@kmantel kmantel reopened this Jul 27, 2023
jdcpni and others added 7 commits July 29, 2023 17:41
• inputport.py
  _parse_port_specific_specs(): fix bug in which COMBINE was not parsed when specified in an InputPort specification dict (though still some weirdness in passing spec through to constructor, requiring function assignment in place)

• port.py
  _parse_port_spec():  add passing of Context.string for local handling based on caller (e.g., warning messages)
• EMstoragemechanism.py
  - refactor memory_matrix to use learning_signals

 • emcomposition.py
   - refactor to use memory_matrix of storage_node if that is implemented

Co-authored-by: jdcpni <pniintel55>
…by 40x

It's still enough to recover the parameters and reduces test time
significantly.

Signed-off-by: Jan Vesely <[email protected]>
…niversity#2753)

Reduce the number of estimates by a factor of 40, it's enough to pass the test and it significantly reduces test running time.
Provide expected results for different optimization methods
* origin/devel:
  tests/ParameterEstimationComposition: Reduce the number of estimates by 40x
  tests/ParameterEstimationComposition: Provide expected result instead of relying on tolerance
  requirements: update dill requirement from <0.3.7 to <0.3.8 (PrincetonUniversity#2743)
  Feat/em composition refactor learning mech (PrincetonUniversity#2754)
  Fix/input port combine (PrincetonUniversity#2755)
  requirements: update beartype requirement from <0.15.0 to <0.16.0 (PrincetonUniversity#2744)
@github-actions
Copy link

github-actions bot commented Aug 1, 2023

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

diff -r docs-base/ControlSignal.html docs-head/ControlSignal.html
859c859
< <span class="sig-name descname"><span class="pre">_parse_port_specific_specs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">owner</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">port_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">port_specific_spec</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#psyneulink.core.components.ports.modulatorysignals.controlsignal.ControlSignal._parse_port_specific_specs" title="Permalink to this definition">¶</a></dt>
---
> <span class="sig-name descname"><span class="pre">_parse_port_specific_specs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">owner</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">port_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">port_specific_spec</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">context</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#psyneulink.core.components.ports.modulatorysignals.controlsignal.ControlSignal._parse_port_specific_specs" title="Permalink to this definition">¶</a></dt>
diff -r docs-base/EMComposition.html docs-head/EMComposition.html
382c382
< are retrieved and assigned as the <a class="reference internal" href="Mechanism.html#psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.value" title="psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of the corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_node</span></code></a>. This distinction between keys and value implements a standard “dictionary; however,
---
> are retrieved and assigned as the <a class="reference internal" href="Mechanism.html#psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.value" title="psyneulink.core.components.mechanisms.mechanism.Mechanism_Base.value"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">value</span></code></a> of the corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieved_node</span></code></a>. This distinction between keys and value implements a standard “dictionary; however,
424c424
< <p>All <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">key_input_nodes</span></code></a> and <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_nodes</span></code></a>
---
> <p>All <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">key_input_nodes</span></code></a> and <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieved_nodes</span></code></a>
470c470
< from the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_weighting_node</span></code></a> to each of the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_nodes</span></code></a>. Memories associated with each key are also stored in the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameters of the <code class="xref any docutils literal notranslate"><span class="pre">MappingProjections</span></code> from the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">key_input_nodes</span></code></a> to each of the corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.match_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.match_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">match_nodes</span></code></a>.
---
> from the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.softmax_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.softmax_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">softmax_weighting_node</span></code></a> to each of the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieved_nodes</span></code></a>. Memories associated with each key are also stored in the <a class="reference internal" href="MappingProjection.html#psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix" title="psyneulink.core.components.projections.pathway.mappingprojection.MappingProjection.matrix"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">matrix</span></code></a> parameters of the <code class="xref any docutils literal notranslate"><span class="pre">MappingProjections</span></code> from the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.key_input_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">key_input_nodes</span></code></a> to each of the corresponding <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.match_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.match_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">match_nodes</span></code></a>.
475,476c475,476
< in the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_weighting_node</span></code></a> through its Projection to each
< <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_node</span></code></a> (which computes the dot product of the weighted softmax over
---
> in the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.softmax_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.softmax_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">softmax_weighting_node</span></code></a> through its Projection to each
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieved_node</span></code></a> (which computes the dot product of the weighted softmax over
483c483
< <p>The outputs corresponding to retrieved value for each field are represented as <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">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition, listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_nodes</span></code></a> attribute.</p>
---
> <p>The outputs corresponding to retrieved value for each field are represented as <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">OUTPUT</span></code></a> <a class="reference internal" href="Composition.html#composition-nodes"><span class="std std-ref">Nodes</span></a> of the EMComposition, listed in its <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieved_nodes</span></code></a> attribute.</p>
513c513
< <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_weighting_node</span></code></a>, which applies the corresponding <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_weight</span></code></a> to the softmaxed dot products of memories for each field, and then haddamard sums
---
> <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.softmax_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.softmax_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">softmax_weighting_node</span></code></a>, which applies the corresponding <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_weight</span></code></a> to the softmaxed dot products of memories for each field, and then haddamard sums
515c515
< <li><p><strong>Retrieve values by field</strong>. The vector of weights for each memory generated by the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_weighting_node</span></code></a> is passed through the Projections to the each of the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_nodes</span></code></a> to compute the retrieved value for each field.</p></li>
---
> <li><p><strong>Retrieve values by field</strong>. The vector of weights for each memory generated by the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.softmax_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.softmax_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">softmax_weighting_node</span></code></a> is passed through the Projections to the each of the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieved_nodes</span></code></a> to compute the retrieved value for each field.</p></li>
521c521
< the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_weighting_node</span></code></a> to each of the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieval_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieval_nodes</span></code></a>, as well as 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> parameter of the
---
> the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.softmax_weighting_node" title="psyneulink.library.compositions.emcomposition.EMComposition.softmax_weighting_node"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">softmax_weighting_node</span></code></a> to each of the <a class="reference internal" href="#psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes" title="psyneulink.library.compositions.emcomposition.EMComposition.retrieved_nodes"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">retrieved_nodes</span></code></a>, as well as the <a class="reference internal
...

See CI logs for the full diff.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@kmantel kmantel merged commit 424971b into PrincetonUniversity:master Aug 1, 2023
30 of 31 checks passed
@kmantel kmantel deleted the master-devel branch August 1, 2023 23:22
@kmantel kmantel restored the master-devel branch August 2, 2023 01:27
@kmantel kmantel deleted the master-devel branch August 2, 2023 01:30
@kmantel kmantel restored the master-devel branch August 2, 2023 01:30
@kmantel kmantel deleted the master-devel branch August 2, 2023 03:42
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.

3 participants