Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Feat/autodiff various #2524

Merged
merged 61 commits into from
Nov 9, 2022
Merged

Feat/autodiff various #2524

merged 61 commits into from
Nov 9, 2022

Conversation

jdcpni
Copy link
Collaborator

@jdcpni jdcpni commented Nov 6, 2022

• autodiffcomposition.py:

  • add save() and load() methods (from Samyak)
    • augment file and directory handling including Posix paths
    • exclude processing of CIM, learning, and other modulation-related projections
    • correct handle_context
    • fix path construction ('/' -> join)
    • save():
      • return stored Path object
      • add projection.matrix.base = matrix (fixes test_autodiff_saveload)
  • support SoftMax TransferFunction
  • learning_rate as arg passed as arg in learn()
    NOTE: not (yet) supported for Composition.learn()
    • add _runtime_learning_rate attribute
    • _build_pytorch_representation():
      use _runtime_learning_rate attribute for optimizer if provided in call to learn()
      else use learning_rate specified at construction

• compositionrunner.py:

  • assign learning_rate to _runtime_learning_rate attribute if specified in call to learn

• test_autodiffcomposition.py:

  • test_autodiff_saveload: modify to use current working directory rather than tmp

SamKG and others added 25 commits November 1, 2022 17:03
…Link into devel

� Conflicts:
�	Scripts/Models (Under Development)/N-back.py
  - add save and load methods (from Samyak)
  - test_autodiffcomposition.py:
    add test_autodiff_saveload, but commented out for now, as it may be causing hanging on PR
  - add save and load methods (from Samyak)
  - test_autodiffcomposition.py:
    add test_autodiff_saveload, but commented out for now, as it may be causing hanging on PR
…Link into feat/autodiff_various

� Conflicts:
�	Scripts/Models (Under Development)/N-back.py
�	tests/mdf/model_basic.yml
  - pytorch_function_creator: add SoftMax

• transferfunctions.py:
  - disable changes to ReLU.derivative for now
  - iscompatible:
    attempt to replace try and except, commented out for now
  - save and load: augment file and directory handling
  - exclude processing of any ModulatoryProjections
@github-actions
Copy link

github-actions bot commented Nov 6, 2022

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
491a492,534
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.save">
> <span class="sig-name descname"><span class="pre">save</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.save" title="Permalink to this definition">¶</a></dt>
> <dd><p>Saves all weight matrices for all MappingProjections in the AutodiffComposition
> :type directory: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]
> :param directory: directory where <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">matrices</span></code></a> for all MappingProjections</p>
> <blockquote>
> <div><p>in the AutodiffComposition are saved.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – filename in which <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">matrices</span></code></a> for all MappingProjections
> in the AutodiffComposition are saved.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – Matrices are saved in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p></li>
> </ul>
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.load">
> <span class="sig-name descname"><span class="pre">load</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.load" title="Permalink to this definition">¶</a></dt>
> <dd><p>Loads all weights matrices for all MappingProjections in the AutodiffComposition from file
> :type path: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">Path</span></code>]
> :param path: Path for file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p>
> <blockquote>
> <div><p>This must be a legal PosixPath object; if it is specified <strong>directory</strong> and <strong>filename</strong> are ignored.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>directory</strong> (str : default <code class="docutils literal notranslate"><span class="pre">current</span> <span class="pre">working</span> <span class="pre">directory</span></code>) – directory where <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – name of file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – <p>Matrices must be stored in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p>
> </p></li>
> </ul>
> </dd>
> </dl>
> </dd></dl>
> 
diff -r docs-base/genindex.html docs-head/genindex.html
2821,2822d2820
<   </ul></td>
<   <td style="width: 33%; vertical-align: top;"><ul>
2848a2847,2848
>   </ul></td>
>   <td style="width: 33%; vertical-align: top;"><ul>
2886a2887,2888
>       <li><a href="AutodiffComposition.html#psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.load">load() (psyneulink.library.compositions.autodiffcomposition.AutodiffComposition method)</a>
> </li>
5036a5039,5040
>       <li><a href="AutodiffComposition.html#psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.save">save() (psyneulink.library.compositions.autodiffcomposition.AutodiffComposition method)</a>
> </li>
5179,5180d5182
<       <li><a href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator.short_term_gain">short_term_gain (psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator attribute)</a>
< </li>
5182a5185,5186
>       <li><a href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator.short_term_gain">short_term_gain (psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator attribute)</a>
> </li>
Binary files docs-base/objects.inv and docs-head/objects.inv differ
diff -r docs-base/searchindex.js docs-head/searchindex.js
1c1
< Search.setIndex({docnames:["AGT","AGTControlMechanism","AutoAssociativeLearningMechanism","AutoAssociativeProjection","AutodiffComposition","BasicsAndPrimer","BeukersNBackModel","BotvinickConflictMonitoringModel","BustamanteStroopXORLVOCModel","Cohen_HustonModel","CombinationFunctions","ComparatorMechanism","Compilation","Component","Components","Composition","CompositionFunctionApproximator","CompositionInterfaceMechanism","Compositions","Condition","Context","ContrastiveHebbianMechanism","ContributorsGuide","ControlMechanism","ControlMechanisms","ControlProjection","ControlProjections","ControlSignal","ConventionsAndDefinitions","Core","DDM","DefaultControlMechanism","Defaults","DistributionFunctions","EVC","EVCAuxiliary","EVCControlMechanism","EpisodicMemoryMechanism","Function","Functions","GatingMechanism","GatingMechanisms","GatingProjection","GatingProjections","GatingSignal","GilzenratModel","InputPort","IntegratorFunctions","IntegratorMechanism","IntegratorMechanisms","KWTAMechanism","Keywords","KohonenMechanism","LCAMechanism","LCControlMechanism","LCMechanism","LeabraMechanism","LearningFunctions","LearningMechanism","LearningMechanisms","LearningProjection","LearningProjections","LearningSignal","Library","Log","MappingProjection","MaskedMappingProjection","Mechanism","Mechanisms","MemoryFunctions","Models","ModulatoryMechanism","ModulatoryMechanisms","ModulatoryProjection","ModulatoryProjections","ModulatorySignal","MontagueModel","NieuwenhuisModel","NonStatefulFunctions","ObjectiveFunctions","ObjectiveMechanism","ObjectiveMechanisms","OptimizationControlMechanism","OptimizationFunctions","OutputPort","PCTC_model","ParameterEstimationComposition","ParameterPort","Parameters","Pathway","PathwayProjection","PathwayProjections","Port","PredictionErrorMechanism","Preferences","ProcessingMechanism","ProcessingMechanisms","Projection","Projections","QuickReference","RecurrentTransferMechanism","RefactoredLearningGuide","Registry","RegressionCFA","Report","Scheduler","Scheduling","SelectionFunctions","Services","StatefulFunction","StatefulFunctions","Subystems","Time","TransferFunctions","TransferMechanism","TransferMechanisms","UserDefinedFunction","UserGuide","UserGuide_TBD","Visualization","globals","index","index_logo_with_text","mdf"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["AGT.rst","AGTControlMechanism.rst","AutoAssociativeLearningMechanism.rst","AutoAssociativeProjection.rst","AutodiffComposition.rst","BasicsAndPrimer.rst","BeukersNBackModel.rst","BotvinickConflictMonitoringModel.rst","BustamanteStroopXORLVOCModel.rst","Cohen_HustonModel.rst","CombinationFunctions.rst","ComparatorMechanism.rst","Compilation.rst","Component.rst","Components.rst","Composition.rst","CompositionFunctionApproximator.rst","CompositionInterfaceMechanism.rst","Compositions.rst","Condition.rst","Context.rst","ContrastiveHebbianMechanism.rst","ContributorsGuide.rst","ControlMechanism.rst","ControlMechanisms.rst","ControlProjection.rst","ControlProjections.rst","ControlSignal.rst","ConventionsAndDefinitions.rst","Core.rst","DDM.rst","DefaultControlMechanism.rst","Defaults.rst","DistributionFunctions.rst","EVC.rst","EVCAuxiliary.rst","EVCControlMechanism.rst","EpisodicMemoryMechanism.rst","Function.rst","Functions.rst","GatingMechanism.rst","GatingMechanisms.rst","GatingProjection.rst","GatingProjections.rst","GatingSignal.rst","GilzenratModel.rst","InputPort.rst","IntegratorFunctions.rst","IntegratorMechanism.rst","IntegratorMechanisms.rst","KWTAMechanism.rst","Keywords.rst","KohonenMechanism.rst","LCAMechanism.rst","LCControlMechanism.rst","LCMechanism.rst","LeabraMechanism.rst","LearningFunctions.rst","LearningMechanism.rst","LearningMechanisms.rst","LearningProjection.rst","LearningProjections.rst","LearningSignal.rst","Library.rst","Log.rst","MappingProjection.rst","MaskedMappingProjection.rst","Mechanism.rst","Mechanisms.rst","MemoryFunctions.rst","Models.rst","ModulatoryMechanism.rst","ModulatoryMechanisms.rst","ModulatoryProjection.rst","ModulatoryProjections.rst","ModulatorySignal.rst","MontagueModel.rst","NieuwenhuisModel.rst","NonStatefulFunctions.rst","ObjectiveFunctions.rst","ObjectiveMechanism.rst","ObjectiveMechanisms.rst","OptimizationControlMechanism.rst","OptimizationFunctions.rst","OutputPort.rst","PCTC_model.rst","ParameterEstimationComposition.rst","ParameterPort.rst","Parameters.rst","Pathway.rst","PathwayProjection.rst","PathwayProjections.rst","Port.rst","PredictionErrorMechanism.rst","Preferences.rst","ProcessingMechanism.rst","ProcessingMechanisms.rst","Projection.rst","Projections.rst","QuickReference.rst","RecurrentTransferMechanism.rst","RefactoredLearningGuide.rst","Registry.rst","RegressionCFA.rst","Report.rst","Scheduler.rst","Scheduling.rst","SelectionFunctions.rst","Services.rst","StatefulFunction.rst","StatefulFunctions.rst","Subystems.rst","Time.rst","TransferFunctions.rst","TransferMechanism.rst","TransferMechanisms.rst","UserDefinedFunction.rst","UserGuide.rst","UserGuide_TBD.rst","Visualization.rst","globals.rst","index.rst","index_logo_with_text.rst","mdf.rst"],objects:{"psyneulink.core.components":{component:[13,0,0,"-"]},"psyneulink.core.components.component":{Component:[13,1,1,""]},"psyneulink.core.components.component.Component":{"function":[13,4,1,""],_check_args:[13,2,1,""],_check_for_composition:[13,2,1,""],_deferred_init:[13,2,1,""],_dependent_components:[13,3,1,""],_get_param_value_from_tuple:[13,2,1,""],_handle_default_variable:[13,2,1,""],_handle_size:[13,2,1,""],_instantiate_defaults:[13,2,1,""],_instantiate_function:[13,2,1,""],_instantiate_parameter_classes:[13,2,1,""],_model_spec_class_name_is_generic:[13,4,1,""],_model_spec_generic_type_name:[13,4,1,""],_model_spec_parameter_blacklist:[13,3,1,""],_parameter_components:[13,3,1,""],_parse_arg_generic:[13,2,1,""],_parse_arg_variable:[13,2,1,""],_parse_function_variable:[13,2,1,""],_set_multiple_parameter_values:[13,2,1,""],_specified_variable_shape_flexibility:[13,4,1,""],_validate:[13,2,1,""],_validate_and_assign_runtime_params:[13,2,1,""],_validate_function:[13,2,1,""],_validate_params:[13,2,1,""],_validate_variable:[13,2,1,""],all_dependent_parameters:[13,2,1,""],current_execution_time:[13,4,1,""],defaults:[13,4,1,""],execute:[13,2,1,""],execute_until_finished:[13,4,1,""],execution_count:[13,4,1,""],function_parameters:[13,3,1,""],initialization_status:[13,4,1,""],is_finished:[13,2,1,""],log:[13,4,1,""],log_values:[13,2,1,""],loggable_items:[13,3,1,""],logged_items:[13,3,1,""],max_executions_before_finished:[13,4,1,""],most_recent_context:[13,3,1,""],name:[13,4,1,""],num_executions:[13,4,1,""],num_executions_before_finished:[13,4,1,""],parameters:[13,4,1,""],prefs:[13,4,1,""],reset:[13,2,1,""],reset_params:[13,2,1,""],reset_stateful_function_when:[13,4,1,""],set_delivery_conditions:[13,2,1,""],set_log_conditions:[13,2,1,""],size:[13,4,1,""],stateful_parameters:[13,3,1,"id0"],value:[13,4,1,""],variable:[13,4,1,""]},"psyneulink.core.components.functions":{"function":[39,0,0,"-"],combinationfunctions:[10,0,0,"-"],distributionfunctions:[33,0,0,"-"],learningfunctions:[57,0,0,"-"],objectivefunctions:[79,0,0,"-"],optimizationfunctions:[83,0,0,"-"],selectionfunctions:[107,0,0,"-"],transferfunctions:[113,0,0,"-"],userdefinedfunction:[116,0,0,"-"]},"psyneulink.core.components.functions.combinationfunctions":{CombineMeans:[10,1,1,""],Concatenate:[10,1,1,""],LinearCombination:[10,1,1,""],PredictionErrorDeltaFunction:[10,1,1,""],Rearrange:[10,1,1,""],Reduce:[10,1,1,""]},"psyneulink.core.components.functions.combinationfunctions.CombineMeans":{_function:[10,2,1,""],_validate_params:[10,2,1,""],_validate_variable:[10,2,1,""],exponents:[10,4,1,""],nam
...

See CI logs for the full diff.

  save(): add projection.matrix.base = matrix
           (fixes test_autodiff_saveload)
@github-actions
Copy link

github-actions bot commented Nov 6, 2022

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
491a492,534
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.save">
> <span class="sig-name descname"><span class="pre">save</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.save" title="Permalink to this definition">¶</a></dt>
> <dd><p>Saves all weight matrices for all MappingProjections in the AutodiffComposition
> :type directory: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]
> :param directory: directory where <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">matrices</span></code></a> for all MappingProjections</p>
> <blockquote>
> <div><p>in the AutodiffComposition are saved.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – filename in which <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">matrices</span></code></a> for all MappingProjections
> in the AutodiffComposition are saved.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – Matrices are saved in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p></li>
> </ul>
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.load">
> <span class="sig-name descname"><span class="pre">load</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.load" title="Permalink to this definition">¶</a></dt>
> <dd><p>Loads all weights matrices for all MappingProjections in the AutodiffComposition from file
> :type path: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">PosixPath</span></code>]
> :param path: Path for file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p>
> <blockquote>
> <div><p>This must be a legal PosixPath object; if it is specified <strong>directory</strong> and <strong>filename</strong> are ignored.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>directory</strong> (str : default <code class="docutils literal notranslate"><span class="pre">current</span> <span class="pre">working</span> <span class="pre">directory</span></code>) – directory where <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – name of file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – <p>Matrices must be stored in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p>
> </p></li>
> </ul>
> </dd>
> </dl>
> </dd></dl>
> 
diff -r docs-base/genindex.html docs-head/genindex.html
2821,2822d2820
<   </ul></td>
<   <td style="width: 33%; vertical-align: top;"><ul>
2848a2847,2848
>   </ul></td>
>   <td style="width: 33%; vertical-align: top;"><ul>
2886a2887,2888
>       <li><a href="AutodiffComposition.html#psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.load">load() (psyneulink.library.compositions.autodiffcomposition.AutodiffComposition method)</a>
> </li>
5036a5039,5040
>       <li><a href="AutodiffComposition.html#psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.save">save() (psyneulink.library.compositions.autodiffcomposition.AutodiffComposition method)</a>
> </li>
5179,5180d5182
<       <li><a href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator.short_term_gain">short_term_gain (psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator attribute)</a>
< </li>
5182a5185,5186
>       <li><a href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator.short_term_gain">short_term_gain (psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator attribute)</a>
> </li>
Binary files docs-base/objects.inv and docs-head/objects.inv differ
diff -r docs-base/searchindex.js docs-head/searchindex.js
1c1
< Search.setIndex({docnames:["AGT","AGTControlMechanism","AutoAssociativeLearningMechanism","AutoAssociativeProjection","AutodiffComposition","BasicsAndPrimer","BeukersNBackModel","BotvinickConflictMonitoringModel","BustamanteStroopXORLVOCModel","Cohen_HustonModel","CombinationFunctions","ComparatorMechanism","Compilation","Component","Components","Composition","CompositionFunctionApproximator","CompositionInterfaceMechanism","Compositions","Condition","Context","ContrastiveHebbianMechanism","ContributorsGuide","ControlMechanism","ControlMechanisms","ControlProjection","ControlProjections","ControlSignal","ConventionsAndDefinitions","Core","DDM","DefaultControlMechanism","Defaults","DistributionFunctions","EVC","EVCAuxiliary","EVCControlMechanism","EpisodicMemoryMechanism","Function","Functions","GatingMechanism","GatingMechanisms","GatingProjection","GatingProjections","GatingSignal","GilzenratModel","InputPort","IntegratorFunctions","IntegratorMechanism","IntegratorMechanisms","KWTAMechanism","Keywords","KohonenMechanism","LCAMechanism","LCControlMechanism","LCMechanism","LeabraMechanism","LearningFunctions","LearningMechanism","LearningMechanisms","LearningProjection","LearningProjections","LearningSignal","Library","Log","MappingProjection","MaskedMappingProjection","Mechanism","Mechanisms","MemoryFunctions","Models","ModulatoryMechanism","ModulatoryMechanisms","ModulatoryProjection","ModulatoryProjections","ModulatorySignal","MontagueModel","NieuwenhuisModel","NonStatefulFunctions","ObjectiveFunctions","ObjectiveMechanism","ObjectiveMechanisms","OptimizationControlMechanism","OptimizationFunctions","OutputPort","PCTC_model","ParameterEstimationComposition","ParameterPort","Parameters","Pathway","PathwayProjection","PathwayProjections","Port","PredictionErrorMechanism","Preferences","ProcessingMechanism","ProcessingMechanisms","Projection","Projections","QuickReference","RecurrentTransferMechanism","RefactoredLearningGuide","Registry","RegressionCFA","Report","Scheduler","Scheduling","SelectionFunctions","Services","StatefulFunction","StatefulFunctions","Subystems","Time","TransferFunctions","TransferMechanism","TransferMechanisms","UserDefinedFunction","UserGuide","UserGuide_TBD","Visualization","globals","index","index_logo_with_text","mdf"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["AGT.rst","AGTControlMechanism.rst","AutoAssociativeLearningMechanism.rst","AutoAssociativeProjection.rst","AutodiffComposition.rst","BasicsAndPrimer.rst","BeukersNBackModel.rst","BotvinickConflictMonitoringModel.rst","BustamanteStroopXORLVOCModel.rst","Cohen_HustonModel.rst","CombinationFunctions.rst","ComparatorMechanism.rst","Compilation.rst","Component.rst","Components.rst","Composition.rst","CompositionFunctionApproximator.rst","CompositionInterfaceMechanism.rst","Compositions.rst","Condition.rst","Context.rst","ContrastiveHebbianMechanism.rst","ContributorsGuide.rst","ControlMechanism.rst","ControlMechanisms.rst","ControlProjection.rst","ControlProjections.rst","ControlSignal.rst","ConventionsAndDefinitions.rst","Core.rst","DDM.rst","DefaultControlMechanism.rst","Defaults.rst","DistributionFunctions.rst","EVC.rst","EVCAuxiliary.rst","EVCControlMechanism.rst","EpisodicMemoryMechanism.rst","Function.rst","Functions.rst","GatingMechanism.rst","GatingMechanisms.rst","GatingProjection.rst","GatingProjections.rst","GatingSignal.rst","GilzenratModel.rst","InputPort.rst","IntegratorFunctions.rst","IntegratorMechanism.rst","IntegratorMechanisms.rst","KWTAMechanism.rst","Keywords.rst","KohonenMechanism.rst","LCAMechanism.rst","LCControlMechanism.rst","LCMechanism.rst","LeabraMechanism.rst","LearningFunctions.rst","LearningMechanism.rst","LearningMechanisms.rst","LearningProjection.rst","LearningProjections.rst","LearningSignal.rst","Library.rst","Log.rst","MappingProjection.rst","MaskedMappingProjection.rst","Mechanism.rst","Mechanisms.rst","MemoryFunctions.rst","Models.rst","ModulatoryMechanism.rst","ModulatoryMechanisms.rst","ModulatoryProjection.rst","ModulatoryProjections.rst","ModulatorySignal.rst","MontagueModel.rst","NieuwenhuisModel.rst","NonStatefulFunctions.rst","ObjectiveFunctions.rst","ObjectiveMechanism.rst","ObjectiveMechanisms.rst","OptimizationControlMechanism.rst","OptimizationFunctions.rst","OutputPort.rst","PCTC_model.rst","ParameterEstimationComposition.rst","ParameterPort.rst","Parameters.rst","Pathway.rst","PathwayProjection.rst","PathwayProjections.rst","Port.rst","PredictionErrorMechanism.rst","Preferences.rst","ProcessingMechanism.rst","ProcessingMechanisms.rst","Projection.rst","Projections.rst","QuickReference.rst","RecurrentTransferMechanism.rst","RefactoredLearningGuide.rst","Registry.rst","RegressionCFA.rst","Report.rst","Scheduler.rst","Scheduling.rst","SelectionFunctions.rst","Services.rst","StatefulFunction.rst","StatefulFunctions.rst","Subystems.rst","Time.rst","TransferFunctions.rst","TransferMechanism.rst","TransferMechanisms.rst","UserDefinedFunction.rst","UserGuide.rst","UserGuide_TBD.rst","Visualization.rst","globals.rst","index.rst","index_logo_with_text.rst","mdf.rst"],objects:{"psyneulink.core.components":{component:[13,0,0,"-"]},"psyneulink.core.components.component":{Component:[13,1,1,""]},"psyneulink.core.components.component.Component":{"function":[13,4,1,""],_check_args:[13,2,1,""],_check_for_composition:[13,2,1,""],_deferred_init:[13,2,1,""],_dependent_components:[13,3,1,""],_get_param_value_from_tuple:[13,2,1,""],_handle_default_variable:[13,2,1,""],_handle_size:[13,2,1,""],_instantiate_defaults:[13,2,1,""],_instantiate_function:[13,2,1,""],_instantiate_parameter_classes:[13,2,1,""],_model_spec_class_name_is_generic:[13,4,1,""],_model_spec_generic_type_name:[13,4,1,""],_model_spec_parameter_blacklist:[13,3,1,""],_parameter_components:[13,3,1,""],_parse_arg_generic:[13,2,1,""],_parse_arg_variable:[13,2,1,""],_parse_function_variable:[13,2,1,""],_set_multiple_parameter_values:[13,2,1,""],_specified_variable_shape_flexibility:[13,4,1,""],_validate:[13,2,1,""],_validate_and_assign_runtime_params:[13,2,1,""],_validate_function:[13,2,1,""],_validate_params:[13,2,1,""],_validate_variable:[13,2,1,""],all_dependent_parameters:[13,2,1,""],current_execution_time:[13,4,1,""],defaults:[13,4,1,""],execute:[13,2,1,""],execute_until_finished:[13,4,1,""],execution_count:[13,4,1,""],function_parameters:[13,3,1,""],initialization_status:[13,4,1,""],is_finished:[13,2,1,""],log:[13,4,1,""],log_values:[13,2,1,""],loggable_items:[13,3,1,""],logged_items:[13,3,1,""],max_executions_before_finished:[13,4,1,""],most_recent_context:[13,3,1,""],name:[13,4,1,""],num_executions:[13,4,1,""],num_executions_before_finished:[13,4,1,""],parameters:[13,4,1,""],prefs:[13,4,1,""],reset:[13,2,1,""],reset_params:[13,2,1,""],reset_stateful_function_when:[13,4,1,""],set_delivery_conditions:[13,2,1,""],set_log_conditions:[13,2,1,""],size:[13,4,1,""],stateful_parameters:[13,3,1,"id0"],value:[13,4,1,""],variable:[13,4,1,""]},"psyneulink.core.components.functions":{"function":[39,0,0,"-"],combinationfunctions:[10,0,0,"-"],distributionfunctions:[33,0,0,"-"],learningfunctions:[57,0,0,"-"],objectivefunctions:[79,0,0,"-"],optimizationfunctions:[83,0,0,"-"],selectionfunctions:[107,0,0,"-"],transferfunctions:[113,0,0,"-"],userdefinedfunction:[116,0,0,"-"]},"psyneulink.core.components.functions.combinationfunctions":{CombineMeans:[10,1,1,""],Concatenate:[10,1,1,""],LinearCombination:[10,1,1,""],PredictionErrorDeltaFunction:[10,1,1,""],Rearrange:[10,1,1,""],Re
...

See CI logs for the full diff.

1 similar comment
@github-actions
Copy link

github-actions bot commented Nov 6, 2022

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
491a492,534
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.save">
> <span class="sig-name descname"><span class="pre">save</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.save" title="Permalink to this definition">¶</a></dt>
> <dd><p>Saves all weight matrices for all MappingProjections in the AutodiffComposition
> :type directory: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]
> :param directory: directory where <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">matrices</span></code></a> for all MappingProjections</p>
> <blockquote>
> <div><p>in the AutodiffComposition are saved.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – filename in which <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">matrices</span></code></a> for all MappingProjections
> in the AutodiffComposition are saved.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – Matrices are saved in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p></li>
> </ul>
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.load">
> <span class="sig-name descname"><span class="pre">load</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.load" title="Permalink to this definition">¶</a></dt>
> <dd><p>Loads all weights matrices for all MappingProjections in the AutodiffComposition from file
> :type path: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">PosixPath</span></code>]
> :param path: Path for file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p>
> <blockquote>
> <div><p>This must be a legal PosixPath object; if it is specified <strong>directory</strong> and <strong>filename</strong> are ignored.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>directory</strong> (str : default <code class="docutils literal notranslate"><span class="pre">current</span> <span class="pre">working</span> <span class="pre">directory</span></code>) – directory where <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – name of file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – <p>Matrices must be stored in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p>
> </p></li>
> </ul>
> </dd>
> </dl>
> </dd></dl>
> 
diff -r docs-base/genindex.html docs-head/genindex.html
2821,2822d2820
<   </ul></td>
<   <td style="width: 33%; vertical-align: top;"><ul>
2848a2847,2848
>   </ul></td>
>   <td style="width: 33%; vertical-align: top;"><ul>
2886a2887,2888
>       <li><a href="AutodiffComposition.html#psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.load">load() (psyneulink.library.compositions.autodiffcomposition.AutodiffComposition method)</a>
> </li>
5036a5039,5040
>       <li><a href="AutodiffComposition.html#psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.save">save() (psyneulink.library.compositions.autodiffcomposition.AutodiffComposition method)</a>
> </li>
5179,5180d5182
<       <li><a href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator.short_term_gain">short_term_gain (psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator attribute)</a>
< </li>
5182a5185,5186
>       <li><a href="IntegratorFunctions.html#psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator.short_term_gain">short_term_gain (psyneulink.core.components.functions.stateful.integratorfunctions.DualAdaptiveIntegrator attribute)</a>
> </li>
Binary files docs-base/objects.inv and docs-head/objects.inv differ
diff -r docs-base/searchindex.js docs-head/searchindex.js
1c1
< Search.setIndex({docnames:["AGT","AGTControlMechanism","AutoAssociativeLearningMechanism","AutoAssociativeProjection","AutodiffComposition","BasicsAndPrimer","BeukersNBackModel","BotvinickConflictMonitoringModel","BustamanteStroopXORLVOCModel","Cohen_HustonModel","CombinationFunctions","ComparatorMechanism","Compilation","Component","Components","Composition","CompositionFunctionApproximator","CompositionInterfaceMechanism","Compositions","Condition","Context","ContrastiveHebbianMechanism","ContributorsGuide","ControlMechanism","ControlMechanisms","ControlProjection","ControlProjections","ControlSignal","ConventionsAndDefinitions","Core","DDM","DefaultControlMechanism","Defaults","DistributionFunctions","EVC","EVCAuxiliary","EVCControlMechanism","EpisodicMemoryMechanism","Function","Functions","GatingMechanism","GatingMechanisms","GatingProjection","GatingProjections","GatingSignal","GilzenratModel","InputPort","IntegratorFunctions","IntegratorMechanism","IntegratorMechanisms","KWTAMechanism","Keywords","KohonenMechanism","LCAMechanism","LCControlMechanism","LCMechanism","LeabraMechanism","LearningFunctions","LearningMechanism","LearningMechanisms","LearningProjection","LearningProjections","LearningSignal","Library","Log","MappingProjection","MaskedMappingProjection","Mechanism","Mechanisms","MemoryFunctions","Models","ModulatoryMechanism","ModulatoryMechanisms","ModulatoryProjection","ModulatoryProjections","ModulatorySignal","MontagueModel","NieuwenhuisModel","NonStatefulFunctions","ObjectiveFunctions","ObjectiveMechanism","ObjectiveMechanisms","OptimizationControlMechanism","OptimizationFunctions","OutputPort","PCTC_model","ParameterEstimationComposition","ParameterPort","Parameters","Pathway","PathwayProjection","PathwayProjections","Port","PredictionErrorMechanism","Preferences","ProcessingMechanism","ProcessingMechanisms","Projection","Projections","QuickReference","RecurrentTransferMechanism","RefactoredLearningGuide","Registry","RegressionCFA","Report","Scheduler","Scheduling","SelectionFunctions","Services","StatefulFunction","StatefulFunctions","Subystems","Time","TransferFunctions","TransferMechanism","TransferMechanisms","UserDefinedFunction","UserGuide","UserGuide_TBD","Visualization","globals","index","index_logo_with_text","mdf"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["AGT.rst","AGTControlMechanism.rst","AutoAssociativeLearningMechanism.rst","AutoAssociativeProjection.rst","AutodiffComposition.rst","BasicsAndPrimer.rst","BeukersNBackModel.rst","BotvinickConflictMonitoringModel.rst","BustamanteStroopXORLVOCModel.rst","Cohen_HustonModel.rst","CombinationFunctions.rst","ComparatorMechanism.rst","Compilation.rst","Component.rst","Components.rst","Composition.rst","CompositionFunctionApproximator.rst","CompositionInterfaceMechanism.rst","Compositions.rst","Condition.rst","Context.rst","ContrastiveHebbianMechanism.rst","ContributorsGuide.rst","ControlMechanism.rst","ControlMechanisms.rst","ControlProjection.rst","ControlProjections.rst","ControlSignal.rst","ConventionsAndDefinitions.rst","Core.rst","DDM.rst","DefaultControlMechanism.rst","Defaults.rst","DistributionFunctions.rst","EVC.rst","EVCAuxiliary.rst","EVCControlMechanism.rst","EpisodicMemoryMechanism.rst","Function.rst","Functions.rst","GatingMechanism.rst","GatingMechanisms.rst","GatingProjection.rst","GatingProjections.rst","GatingSignal.rst","GilzenratModel.rst","InputPort.rst","IntegratorFunctions.rst","IntegratorMechanism.rst","IntegratorMechanisms.rst","KWTAMechanism.rst","Keywords.rst","KohonenMechanism.rst","LCAMechanism.rst","LCControlMechanism.rst","LCMechanism.rst","LeabraMechanism.rst","LearningFunctions.rst","LearningMechanism.rst","LearningMechanisms.rst","LearningProjection.rst","LearningProjections.rst","LearningSignal.rst","Library.rst","Log.rst","MappingProjection.rst","MaskedMappingProjection.rst","Mechanism.rst","Mechanisms.rst","MemoryFunctions.rst","Models.rst","ModulatoryMechanism.rst","ModulatoryMechanisms.rst","ModulatoryProjection.rst","ModulatoryProjections.rst","ModulatorySignal.rst","MontagueModel.rst","NieuwenhuisModel.rst","NonStatefulFunctions.rst","ObjectiveFunctions.rst","ObjectiveMechanism.rst","ObjectiveMechanisms.rst","OptimizationControlMechanism.rst","OptimizationFunctions.rst","OutputPort.rst","PCTC_model.rst","ParameterEstimationComposition.rst","ParameterPort.rst","Parameters.rst","Pathway.rst","PathwayProjection.rst","PathwayProjections.rst","Port.rst","PredictionErrorMechanism.rst","Preferences.rst","ProcessingMechanism.rst","ProcessingMechanisms.rst","Projection.rst","Projections.rst","QuickReference.rst","RecurrentTransferMechanism.rst","RefactoredLearningGuide.rst","Registry.rst","RegressionCFA.rst","Report.rst","Scheduler.rst","Scheduling.rst","SelectionFunctions.rst","Services.rst","StatefulFunction.rst","StatefulFunctions.rst","Subystems.rst","Time.rst","TransferFunctions.rst","TransferMechanism.rst","TransferMechanisms.rst","UserDefinedFunction.rst","UserGuide.rst","UserGuide_TBD.rst","Visualization.rst","globals.rst","index.rst","index_logo_with_text.rst","mdf.rst"],objects:{"psyneulink.core.components":{component:[13,0,0,"-"]},"psyneulink.core.components.component":{Component:[13,1,1,""]},"psyneulink.core.components.component.Component":{"function":[13,4,1,""],_check_args:[13,2,1,""],_check_for_composition:[13,2,1,""],_deferred_init:[13,2,1,""],_dependent_components:[13,3,1,""],_get_param_value_from_tuple:[13,2,1,""],_handle_default_variable:[13,2,1,""],_handle_size:[13,2,1,""],_instantiate_defaults:[13,2,1,""],_instantiate_function:[13,2,1,""],_instantiate_parameter_classes:[13,2,1,""],_model_spec_class_name_is_generic:[13,4,1,""],_model_spec_generic_type_name:[13,4,1,""],_model_spec_parameter_blacklist:[13,3,1,""],_parameter_components:[13,3,1,""],_parse_arg_generic:[13,2,1,""],_parse_arg_variable:[13,2,1,""],_parse_function_variable:[13,2,1,""],_set_multiple_parameter_values:[13,2,1,""],_specified_variable_shape_flexibility:[13,4,1,""],_validate:[13,2,1,""],_validate_and_assign_runtime_params:[13,2,1,""],_validate_function:[13,2,1,""],_validate_params:[13,2,1,""],_validate_variable:[13,2,1,""],all_dependent_parameters:[13,2,1,""],current_execution_time:[13,4,1,""],defaults:[13,4,1,""],execute:[13,2,1,""],execute_until_finished:[13,4,1,""],execution_count:[13,4,1,""],function_parameters:[13,3,1,""],initialization_status:[13,4,1,""],is_finished:[13,2,1,""],log:[13,4,1,""],log_values:[13,2,1,""],loggable_items:[13,3,1,""],logged_items:[13,3,1,""],max_executions_before_finished:[13,4,1,""],most_recent_context:[13,3,1,""],name:[13,4,1,""],num_executions:[13,4,1,""],num_executions_before_finished:[13,4,1,""],parameters:[13,4,1,""],prefs:[13,4,1,""],reset:[13,2,1,""],reset_params:[13,2,1,""],reset_stateful_function_when:[13,4,1,""],set_delivery_conditions:[13,2,1,""],set_log_conditions:[13,2,1,""],size:[13,4,1,""],stateful_parameters:[13,3,1,"id0"],value:[13,4,1,""],variable:[13,4,1,""]},"psyneulink.core.components.functions":{"function":[39,0,0,"-"],combinationfunctions:[10,0,0,"-"],distributionfunctions:[33,0,0,"-"],learningfunctions:[57,0,0,"-"],objectivefunctions:[79,0,0,"-"],optimizationfunctions:[83,0,0,"-"],selectionfunctions:[107,0,0,"-"],transferfunctions:[113,0,0,"-"],userdefinedfunction:[116,0,0,"-"]},"psyneulink.core.components.functions.combinationfunctions":{CombineMeans:[10,1,1,""],Concatenate:[10,1,1,""],LinearCombination:[10,1,1,""],PredictionErrorDeltaFunction:[10,1,1,""],Rearrange:[10,1,1,""],Re
...

See CI logs for the full diff.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 8, 2022

This pull request fixes 1 alert when merging cc9a24c into 259ccef - view on LGTM.com

fixed alerts:

  • 1 for Unreachable code

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 8, 2022

This pull request fixes 1 alert when merging f04f295 into 259ccef - view on LGTM.com

fixed alerts:

  • 1 for Unreachable code

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 8, 2022

This pull request fixes 1 alert when merging d5a5e55 into 259ccef - view on LGTM.com

fixed alerts:

  • 1 for Unreachable code

# Conflicts:
#	psyneulink/library/compositions/autodiffcomposition.py
#	tests/composition/test_autodiffcomposition.py
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
294,296c294,297
< <p>Logging in AutodiffCompositions follows the same procedure as <a class="reference internal" href="Log.html"><span class="doc">logging in a Composition</span></a>. However, since an AutodiffComposition internally converts all of its mechanisms to an equivalent PyTorch model,
< then its inner components are not actually executed. This means that there is limited support for logging parameters of components inside an AutodiffComposition;
< Currently, the only supported parameters are:</p>
---
> <p>Logging in AutodiffCompositions follows the same procedure as <a class="reference internal" href="Log.html"><span class="doc">logging in a Composition</span></a>.
> However, since an AutodiffComposition internally converts all of its mechanisms to an equivalent PyTorch model,
> then its inner components are not actually executed. This means that there is limited support for
> logging parameters of components inside an AutodiffComposition; Currently, the only supported parameters are:</p>
328c329
< <li><p><strong>learning_rate</strong> (<em>float : default 0.001</em>) – the learning rate, which is passed to the optimizer.</p></li>
---
> <li><p><strong>learning_rate</strong> (<em>float : default 0.001</em>) – the learning rate passed to the optimizer if none is specified in the learn method of the AutodiffComposition.</p></li>
345c346
< <dd><p>Updates parameters based on trials ran since last update.</p>
---
> <dd><p>Updates parameters based on trials run since last update.</p>
403a405,408
> <li><p><strong>learning_rate</strong> (<em>float : default None</em>) – specifies the learning_rate used by all <a class="reference internal" href="Composition.html#composition-learning-pathway"><span class="std std-ref">learning pathways</span></a>
> when the Composition’s learn method is called.  This overrides the <a href="#id2"><span class="problematic" id="id3">`</span></a>learning_rate specified
> for any individual Pathways at construction, but only applies for the current execution of
> the learn method.</p></li>
487a493,535
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.save">
> <span class="sig-name descname"><span class="pre">save</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.save" title="Permalink to this definition">¶</a></dt>
> <dd><p>Saves all weight matrices for all MappingProjections in the AutodiffComposition
> :type directory: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]
> :param directory: directory where <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">matrices</span></code></a> for all MappingProjections</p>
> <blockquote>
> <div><p>in the AutodiffComposition are saved.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – filename in which <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">matrices</span></code></a> for all MappingProjections
> in the AutodiffComposition are saved.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – Matrices are saved in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p></li>
> </ul>
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.load">
> <span class="sig-name descname"><span class="pre">load</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.load" title="Permalink to this definition">¶</a></dt>
> <dd><p>Loads all weights matrices for all MappingProjections in the AutodiffComposition from file
> :type path: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">PosixPath</span></code>]
> :param path: Path for file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p>
> <blockquote>
> <div><p>This must be a legal PosixPath object; if it is specified <strong>directory</strong> and <strong>filename</strong> are ignored.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>directory</strong> (str : default <code class="docutils literal notranslate"><span class="pre">current</span> <span class="pre">working</span> <span class="pre">directory</span></code>) – directory where <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – name of file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – <p>Matrices must be stored in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p>
> </p></li>
> </ul>
diff -r docs-base/Composition.html docs-head/Composition.html
628,630c628,630
< outer Composition, are assigned <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> in addition to their other <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">roles</span></code></a> in the
< nested Composition.  The only difference between <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> and <a class="reference internal" href="#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> Nodes
< is whether their output is included in the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> attributes of the <em>outermost</em> Composition to which they project; this is determined by the
---
> outer Composition, are assigned <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> in addition to their other <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">roles</span></code></a> in the
> nested Composition.  The only difference between <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> and <a class="reference internal" href="#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> Nodes
> is whether their output is included in the <a class="reference internal" href="#id23" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> attributes of the <em>outermost</em> Composition to which they project; this is determined by the
633c633
< <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes are <em>not</em> included in the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> or <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> for the outermost Composition to which they project (although they <em>are</em> still included
---
> <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes are <em>not</em> included in the <a class="reference internal" href="#id23" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> or <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> for the outermost Composition to which they project (although they <em>are</em> still included
637c637
< <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.include_probes_in_output" title="psyneulink.core.compositions.composition.Composition.include_probes_in_output"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">include_probes_in_output</span></code></a> is True, then any <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes
---
> <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.include_probes_in_output" title="psyneulink.core.compositions.composition.Composition.include_probes_in_output"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">include_probes_in_output</span></code></a> is True, then any <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes
639,640c639,640
< the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> of the outermost Composition.
< <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xre
...

See CI logs for the full diff.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 8, 2022

This pull request introduces 1 alert and fixes 1 when merging 846a880 into 259ccef - view on LGTM.com

new alerts:

  • 1 for Unused local variable

fixed alerts:

  • 1 for Unreachable code

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
294,296c294,297
< <p>Logging in AutodiffCompositions follows the same procedure as <a class="reference internal" href="Log.html"><span class="doc">logging in a Composition</span></a>. However, since an AutodiffComposition internally converts all of its mechanisms to an equivalent PyTorch model,
< then its inner components are not actually executed. This means that there is limited support for logging parameters of components inside an AutodiffComposition;
< Currently, the only supported parameters are:</p>
---
> <p>Logging in AutodiffCompositions follows the same procedure as <a class="reference internal" href="Log.html"><span class="doc">logging in a Composition</span></a>.
> However, since an AutodiffComposition internally converts all of its mechanisms to an equivalent PyTorch model,
> then its inner components are not actually executed. This means that there is limited support for
> logging parameters of components inside an AutodiffComposition; Currently, the only supported parameters are:</p>
328c329
< <li><p><strong>learning_rate</strong> (<em>float : default 0.001</em>) – the learning rate, which is passed to the optimizer.</p></li>
---
> <li><p><strong>learning_rate</strong> (<em>float : default 0.001</em>) – the learning rate passed to the optimizer if none is specified in the learn method of the AutodiffComposition.</p></li>
345c346
< <dd><p>Updates parameters based on trials ran since last update.</p>
---
> <dd><p>Updates parameters based on trials run since last update.</p>
403a405,408
> <li><p><strong>learning_rate</strong> (<em>float : default None</em>) – specifies the learning_rate used by all <a class="reference internal" href="Composition.html#composition-learning-pathway"><span class="std std-ref">learning pathways</span></a>
> when the Composition’s learn method is called.  This overrides the <a href="#id2"><span class="problematic" id="id3">`</span></a>learning_rate specified
> for any individual Pathways at construction, but only applies for the current execution of
> the learn method.</p></li>
487a493,535
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.save">
> <span class="sig-name descname"><span class="pre">save</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.save" title="Permalink to this definition">¶</a></dt>
> <dd><p>Saves all weight matrices for all MappingProjections in the AutodiffComposition
> :type directory: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]
> :param directory: directory where <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">matrices</span></code></a> for all MappingProjections</p>
> <blockquote>
> <div><p>in the AutodiffComposition are saved.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – filename in which <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">matrices</span></code></a> for all MappingProjections
> in the AutodiffComposition are saved.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – Matrices are saved in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p></li>
> </ul>
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.load">
> <span class="sig-name descname"><span class="pre">load</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.load" title="Permalink to this definition">¶</a></dt>
> <dd><p>Loads all weights matrices for all MappingProjections in the AutodiffComposition from file
> :type path: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">PosixPath</span></code>]
> :param path: Path for file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p>
> <blockquote>
> <div><p>This must be a legal PosixPath object; if it is specified <strong>directory</strong> and <strong>filename</strong> are ignored.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>directory</strong> (str : default <code class="docutils literal notranslate"><span class="pre">current</span> <span class="pre">working</span> <span class="pre">directory</span></code>) – directory where <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – name of file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – <p>Matrices must be stored in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p>
> </p></li>
> </ul>
diff -r docs-base/Composition.html docs-head/Composition.html
628,630c628,630
< outer Composition, are assigned <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> in addition to their other <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">roles</span></code></a> in the
< nested Composition.  The only difference between <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> and <a class="reference internal" href="#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> Nodes
< is whether their output is included in the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> attributes of the <em>outermost</em> Composition to which they project; this is determined by the
---
> outer Composition, are assigned <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> in addition to their other <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">roles</span></code></a> in the
> nested Composition.  The only difference between <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> and <a class="reference internal" href="#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> Nodes
> is whether their output is included in the <a class="reference internal" href="#id23" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> attributes of the <em>outermost</em> Composition to which they project; this is determined by the
633c633
< <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes are <em>not</em> included in the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> or <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> for the outermost Composition to which they project (although they <em>are</em> still included
---
> <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes are <em>not</em> included in the <a class="reference internal" href="#id23" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> or <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> for the outermost Composition to which they project (although they <em>are</em> still included
637c637
< <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.include_probes_in_output" title="psyneulink.core.compositions.composition.Composition.include_probes_in_output"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">include_probes_in_output</span></code></a> is True, then any <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes
---
> <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.include_probes_in_output" title="psyneulink.core.compositions.composition.Composition.include_probes_in_output"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">include_probes_in_output</span></code></a> is True, then any <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes
639,640c639,640
< the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> of the outermost Composition.
< <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xre
...

See CI logs for the full diff.

1 similar comment
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
294,296c294,297
< <p>Logging in AutodiffCompositions follows the same procedure as <a class="reference internal" href="Log.html"><span class="doc">logging in a Composition</span></a>. However, since an AutodiffComposition internally converts all of its mechanisms to an equivalent PyTorch model,
< then its inner components are not actually executed. This means that there is limited support for logging parameters of components inside an AutodiffComposition;
< Currently, the only supported parameters are:</p>
---
> <p>Logging in AutodiffCompositions follows the same procedure as <a class="reference internal" href="Log.html"><span class="doc">logging in a Composition</span></a>.
> However, since an AutodiffComposition internally converts all of its mechanisms to an equivalent PyTorch model,
> then its inner components are not actually executed. This means that there is limited support for
> logging parameters of components inside an AutodiffComposition; Currently, the only supported parameters are:</p>
328c329
< <li><p><strong>learning_rate</strong> (<em>float : default 0.001</em>) – the learning rate, which is passed to the optimizer.</p></li>
---
> <li><p><strong>learning_rate</strong> (<em>float : default 0.001</em>) – the learning rate passed to the optimizer if none is specified in the learn method of the AutodiffComposition.</p></li>
345c346
< <dd><p>Updates parameters based on trials ran since last update.</p>
---
> <dd><p>Updates parameters based on trials run since last update.</p>
403a405,408
> <li><p><strong>learning_rate</strong> (<em>float : default None</em>) – specifies the learning_rate used by all <a class="reference internal" href="Composition.html#composition-learning-pathway"><span class="std std-ref">learning pathways</span></a>
> when the Composition’s learn method is called.  This overrides the <a href="#id2"><span class="problematic" id="id3">`</span></a>learning_rate specified
> for any individual Pathways at construction, but only applies for the current execution of
> the learn method.</p></li>
487a493,535
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.save">
> <span class="sig-name descname"><span class="pre">save</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.save" title="Permalink to this definition">¶</a></dt>
> <dd><p>Saves all weight matrices for all MappingProjections in the AutodiffComposition
> :type directory: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]
> :param directory: directory where <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">matrices</span></code></a> for all MappingProjections</p>
> <blockquote>
> <div><p>in the AutodiffComposition are saved.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – filename in which <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">matrices</span></code></a> for all MappingProjections
> in the AutodiffComposition are saved.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – Matrices are saved in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p></li>
> </ul>
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.load">
> <span class="sig-name descname"><span class="pre">load</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.load" title="Permalink to this definition">¶</a></dt>
> <dd><p>Loads all weights matrices for all MappingProjections in the AutodiffComposition from file
> :type path: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">PosixPath</span></code>]
> :param path: Path for file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p>
> <blockquote>
> <div><p>This must be a legal PosixPath object; if it is specified <strong>directory</strong> and <strong>filename</strong> are ignored.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>directory</strong> (str : default <code class="docutils literal notranslate"><span class="pre">current</span> <span class="pre">working</span> <span class="pre">directory</span></code>) – directory where <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – name of file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – <p>Matrices must be stored in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p>
> </p></li>
> </ul>
diff -r docs-base/Composition.html docs-head/Composition.html
628,630c628,630
< outer Composition, are assigned <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> in addition to their other <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">roles</span></code></a> in the
< nested Composition.  The only difference between <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> and <a class="reference internal" href="#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> Nodes
< is whether their output is included in the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> attributes of the <em>outermost</em> Composition to which they project; this is determined by the
---
> outer Composition, are assigned <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> in addition to their other <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">roles</span></code></a> in the
> nested Composition.  The only difference between <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> and <a class="reference internal" href="#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> Nodes
> is whether their output is included in the <a class="reference internal" href="#id23" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> attributes of the <em>outermost</em> Composition to which they project; this is determined by the
633c633
< <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes are <em>not</em> included in the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> or <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> for the outermost Composition to which they project (although they <em>are</em> still included
---
> <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes are <em>not</em> included in the <a class="reference internal" href="#id23" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> or <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> for the outermost Composition to which they project (although they <em>are</em> still included
637c637
< <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.include_probes_in_output" title="psyneulink.core.compositions.composition.Composition.include_probes_in_output"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">include_probes_in_output</span></code></a> is True, then any <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes
---
> <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.include_probes_in_output" title="psyneulink.core.compositions.composition.Composition.include_probes_in_output"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">include_probes_in_output</span></code></a> is True, then any <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes
639,640c639,640
< the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> of the outermost Composition.
< <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xre
...

See CI logs for the full diff.

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
294,296c294,297
< <p>Logging in AutodiffCompositions follows the same procedure as <a class="reference internal" href="Log.html"><span class="doc">logging in a Composition</span></a>. However, since an AutodiffComposition internally converts all of its mechanisms to an equivalent PyTorch model,
< then its inner components are not actually executed. This means that there is limited support for logging parameters of components inside an AutodiffComposition;
< Currently, the only supported parameters are:</p>
---
> <p>Logging in AutodiffCompositions follows the same procedure as <a class="reference internal" href="Log.html"><span class="doc">logging in a Composition</span></a>.
> However, since an AutodiffComposition internally converts all of its mechanisms to an equivalent PyTorch model,
> then its inner components are not actually executed. This means that there is limited support for
> logging parameters of components inside an AutodiffComposition; Currently, the only supported parameters are:</p>
328c329
< <li><p><strong>learning_rate</strong> (<em>float : default 0.001</em>) – the learning rate, which is passed to the optimizer.</p></li>
---
> <li><p><strong>learning_rate</strong> (<em>float : default 0.001</em>) – the learning rate passed to the optimizer if none is specified in the learn method of the AutodiffComposition.</p></li>
345c346
< <dd><p>Updates parameters based on trials ran since last update.</p>
---
> <dd><p>Updates parameters based on trials run since last update.</p>
403a405,408
> <li><p><strong>learning_rate</strong> (<em>float : default None</em>) – specifies the learning_rate used by all <a class="reference internal" href="Composition.html#composition-learning-pathway"><span class="std std-ref">learning pathways</span></a>
> when the Composition’s learn method is called.  This overrides the <a href="#id2"><span class="problematic" id="id3">`</span></a>learning_rate specified
> for any individual Pathways at construction, but only applies for the current execution of
> the learn method.</p></li>
487a493,535
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.save">
> <span class="sig-name descname"><span class="pre">save</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.save" title="Permalink to this definition">¶</a></dt>
> <dd><p>Saves all weight matrices for all MappingProjections in the AutodiffComposition
> :type directory: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]
> :param directory: directory where <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">matrices</span></code></a> for all MappingProjections</p>
> <blockquote>
> <div><p>in the AutodiffComposition are saved.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – filename in which <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">matrices</span></code></a> for all MappingProjections
> in the AutodiffComposition are saved.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – Matrices are saved in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p></li>
> </ul>
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.load">
> <span class="sig-name descname"><span class="pre">load</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.load" title="Permalink to this definition">¶</a></dt>
> <dd><p>Loads all weights matrices for all MappingProjections in the AutodiffComposition from file
> :type path: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">PosixPath</span></code>]
> :param path: Path for file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p>
> <blockquote>
> <div><p>This must be a legal PosixPath object; if it is specified <strong>directory</strong> and <strong>filename</strong> are ignored.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>directory</strong> (str : default <code class="docutils literal notranslate"><span class="pre">current</span> <span class="pre">working</span> <span class="pre">directory</span></code>) – directory where <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – name of file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – <p>Matrices must be stored in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p>
> </p></li>
> </ul>
diff -r docs-base/Composition.html docs-head/Composition.html
628,630c628,630
< outer Composition, are assigned <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> in addition to their other <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">roles</span></code></a> in the
< nested Composition.  The only difference between <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> and <a class="reference internal" href="#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> Nodes
< is whether their output is included in the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> attributes of the <em>outermost</em> Composition to which they project; this is determined by the
---
> outer Composition, are assigned <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> in addition to their other <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">roles</span></code></a> in the
> nested Composition.  The only difference between <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> and <a class="reference internal" href="#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> Nodes
> is whether their output is included in the <a class="reference internal" href="#id23" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> attributes of the <em>outermost</em> Composition to which they project; this is determined by the
633c633
< <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes are <em>not</em> included in the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> or <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> for the outermost Composition to which they project (although they <em>are</em> still included
---
> <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes are <em>not</em> included in the <a class="reference internal" href="#id23" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> or <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> for the outermost Composition to which they project (although they <em>are</em> still included
637c637
< <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.include_probes_in_output" title="psyneulink.core.compositions.composition.Composition.include_probes_in_output"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">include_probes_in_output</span></code></a> is True, then any <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes
---
> <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.include_probes_in_output" title="psyneulink.core.compositions.composition.Composition.include_probes_in_output"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">include_probes_in_output</span></code></a> is True, then any <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes
639,640c639,640
< the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> of the outermost Composition.
< <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xre
...

See CI logs for the full diff.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 8, 2022

This pull request introduces 1 alert and fixes 1 when merging ba27a4f into 259ccef - view on LGTM.com

new alerts:

  • 1 for Unused local variable

fixed alerts:

  • 1 for Unreachable code

  - fix path assignment bug
…Link into feat/autodiff_various

� Conflicts:
�	.gitignore
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
294,296c294,297
< <p>Logging in AutodiffCompositions follows the same procedure as <a class="reference internal" href="Log.html"><span class="doc">logging in a Composition</span></a>. However, since an AutodiffComposition internally converts all of its mechanisms to an equivalent PyTorch model,
< then its inner components are not actually executed. This means that there is limited support for logging parameters of components inside an AutodiffComposition;
< Currently, the only supported parameters are:</p>
---
> <p>Logging in AutodiffCompositions follows the same procedure as <a class="reference internal" href="Log.html"><span class="doc">logging in a Composition</span></a>.
> However, since an AutodiffComposition internally converts all of its mechanisms to an equivalent PyTorch model,
> then its inner components are not actually executed. This means that there is limited support for
> logging parameters of components inside an AutodiffComposition; Currently, the only supported parameters are:</p>
328c329
< <li><p><strong>learning_rate</strong> (<em>float : default 0.001</em>) – the learning rate, which is passed to the optimizer.</p></li>
---
> <li><p><strong>learning_rate</strong> (<em>float : default 0.001</em>) – the learning rate passed to the optimizer if none is specified in the learn method of the AutodiffComposition.</p></li>
345c346
< <dd><p>Updates parameters based on trials ran since last update.</p>
---
> <dd><p>Updates parameters based on trials run since last update.</p>
403a405,408
> <li><p><strong>learning_rate</strong> (<em>float : default None</em>) – specifies the learning_rate used by all <a class="reference internal" href="Composition.html#composition-learning-pathway"><span class="std std-ref">learning pathways</span></a>
> when the Composition’s learn method is called.  This overrides the <a href="#id2"><span class="problematic" id="id3">`</span></a>learning_rate specified
> for any individual Pathways at construction, but only applies for the current execution of
> the learn method.</p></li>
487a493,539
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.save">
> <span class="sig-name descname"><span class="pre">save</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.save" title="Permalink to this definition">¶</a></dt>
> <dd><p>Saves all weight matrices for all MappingProjections in the AutodiffComposition</p>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>path</strong> (<em>Path</em><em>, </em><em>PosixPath</em><em> or </em><em>str : default None</em>) – path specification; must be a legal path specification in the filesystem.</p></li>
> <li><p><strong>directory</strong> (str : default <code class="docutils literal notranslate"><span class="pre">current</span> <span class="pre">working</span> <span class="pre">directory</span></code>) – directory where <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">matrices</span></code></a> for all MappingProjections
> in the AutodiffComposition are saved.</p></li>
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – filename in which <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">matrices</span></code></a> for all MappingProjections
> in the AutodiffComposition are saved.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – Matrices are saved in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p></li>
> </ul>
> </dd>
> <dt class="field-even">Returns</dt>
> <dd class="field-even"><p></p>
> </dd>
> <dt class="field-odd">Return type</dt>
> <dd class="field-odd"><p>Path</p>
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.load">
> <span class="sig-name descname"><span class="pre">load</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.load" title="Permalink to this definition">¶</a></dt>
> <dd><p>Loads all weights matrices for all MappingProjections in the AutodiffComposition from file
> :type path: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">PosixPath</span></code>]
> :param path: Path for file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p>
> <blockquote>
> <div><p>This must be a legal PosixPath object; if it is specified <strong>directory</strong> and <strong>filename</strong> are ignored.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>directory</strong> (str : default <code class="docutils literal notranslate"><span class="pre">current</span> <span class="pre">working</span> <span class="pre">directory</span></code>) – directory where <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – name of file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – <p>Matrices must be stored in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p>
> </p></li>
> </ul>
diff -r docs-base/Composition.html docs-head/Composition.html
628,630c628,630
< outer Composition, are assigned <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> in addition to their other <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">roles</span></code></a> in the
< nested Composition.  The only difference between <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> and <a class="reference internal" href="#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> Nodes
< is whether their output is included in the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> attributes of the <em>outermost</em> Composition to which they project; this is determined by the
---
> outer Composition, are assigned <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> in addition to their other <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">roles</span></code></a> in the
> nested Composition.  The only difference between <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> and <a class="reference internal" href="#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> Nodes
> is whether their output is included in the <a class="reference internal" href="#id23" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> attributes of the <em>outermost</em> Composition to which they project; this is determined by the
633c633
< <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes are <em>not</em> included in the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> or <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> for the outermost Composition to which they project (although they <em>are</em> still included
---
> <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes are <em>not</em> included in the <a class="reference internal" href="#id23" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> or <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> for the outermost Composition to which they project (although they <em>are</em> still included
637c637
< <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.include_probes_in_output" title="psyneulink.core.compositions.composition.Composition.include_probes_in_output"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">include_probes_in_output</span></code></a> is True, then any <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes
---
> <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.include_probes_in_output" title="psyneulink.core.compositions.composition.Composition.include_probes_in_output"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">include_probes_in_output</span></code></a> is True, then any <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes
639,640c639,640
< the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositio
...

See CI logs for the full diff.

1 similar comment
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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

diff -r docs-base/AutodiffComposition.html docs-head/AutodiffComposition.html
294,296c294,297
< <p>Logging in AutodiffCompositions follows the same procedure as <a class="reference internal" href="Log.html"><span class="doc">logging in a Composition</span></a>. However, since an AutodiffComposition internally converts all of its mechanisms to an equivalent PyTorch model,
< then its inner components are not actually executed. This means that there is limited support for logging parameters of components inside an AutodiffComposition;
< Currently, the only supported parameters are:</p>
---
> <p>Logging in AutodiffCompositions follows the same procedure as <a class="reference internal" href="Log.html"><span class="doc">logging in a Composition</span></a>.
> However, since an AutodiffComposition internally converts all of its mechanisms to an equivalent PyTorch model,
> then its inner components are not actually executed. This means that there is limited support for
> logging parameters of components inside an AutodiffComposition; Currently, the only supported parameters are:</p>
328c329
< <li><p><strong>learning_rate</strong> (<em>float : default 0.001</em>) – the learning rate, which is passed to the optimizer.</p></li>
---
> <li><p><strong>learning_rate</strong> (<em>float : default 0.001</em>) – the learning rate passed to the optimizer if none is specified in the learn method of the AutodiffComposition.</p></li>
345c346
< <dd><p>Updates parameters based on trials ran since last update.</p>
---
> <dd><p>Updates parameters based on trials run since last update.</p>
403a405,408
> <li><p><strong>learning_rate</strong> (<em>float : default None</em>) – specifies the learning_rate used by all <a class="reference internal" href="Composition.html#composition-learning-pathway"><span class="std std-ref">learning pathways</span></a>
> when the Composition’s learn method is called.  This overrides the <a href="#id2"><span class="problematic" id="id3">`</span></a>learning_rate specified
> for any individual Pathways at construction, but only applies for the current execution of
> the learn method.</p></li>
487a493,539
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.save">
> <span class="sig-name descname"><span class="pre">save</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.save" title="Permalink to this definition">¶</a></dt>
> <dd><p>Saves all weight matrices for all MappingProjections in the AutodiffComposition</p>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>path</strong> (<em>Path</em><em>, </em><em>PosixPath</em><em> or </em><em>str : default None</em>) – path specification; must be a legal path specification in the filesystem.</p></li>
> <li><p><strong>directory</strong> (str : default <code class="docutils literal notranslate"><span class="pre">current</span> <span class="pre">working</span> <span class="pre">directory</span></code>) – directory where <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">matrices</span></code></a> for all MappingProjections
> in the AutodiffComposition are saved.</p></li>
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – filename in which <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">matrices</span></code></a> for all MappingProjections
> in the AutodiffComposition are saved.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – Matrices are saved in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p></li>
> </ul>
> </dd>
> <dt class="field-even">Returns</dt>
> <dd class="field-even"><p></p>
> </dd>
> <dt class="field-odd">Return type</dt>
> <dd class="field-odd"><p>Path</p>
> </dd>
> </dl>
> </dd></dl>
> 
> <dl class="py method">
> <dt class="sig sig-object py" id="psyneulink.library.compositions.autodiffcomposition.AutodiffComposition.load">
> <span class="sig-name descname"><span class="pre">load</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">directory</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</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.library.compositions.autodiffcomposition.AutodiffComposition.load" title="Permalink to this definition">¶</a></dt>
> <dd><p>Loads all weights matrices for all MappingProjections in the AutodiffComposition from file
> :type path: <code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">PosixPath</span></code>]
> :param path: Path for file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p>
> <blockquote>
> <div><p>This must be a legal PosixPath object; if it is specified <strong>directory</strong> and <strong>filename</strong> are ignored.</p>
> </div></blockquote>
> <dl class="field-list simple">
> <dt class="field-odd">Parameters</dt>
> <dd class="field-odd"><ul class="simple">
> <li><p><strong>directory</strong> (str : default <code class="docutils literal notranslate"><span class="pre">current</span> <span class="pre">working</span> <span class="pre">directory</span></code>) – directory where <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>filename</strong> (str : default <code class="docutils literal notranslate"><span class="pre">&lt;name</span> <span class="pre">of</span> <span class="pre">AutodiffComposition&gt;_matrix_wts.pnl</span></code>) – name of file in which <a class="reference internal" href="MappingProjection.html"><span class="doc">MappingProjection</span></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">matrices</span></code></a> are stored.</p></li>
> <li><p><strong>note::</strong> (<em>.</em>) – <p>Matrices must be stored in
> <a class="reference external" href="https://pytorch.org/tutorials/beginner/saving_loading_models.html">PyTorch state_dict</a> format.</p>
> </p></li>
> </ul>
diff -r docs-base/Composition.html docs-head/Composition.html
628,630c628,630
< outer Composition, are assigned <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> in addition to their other <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">roles</span></code></a> in the
< nested Composition.  The only difference between <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> and <a class="reference internal" href="#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> Nodes
< is whether their output is included in the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> attributes of the <em>outermost</em> Composition to which they project; this is determined by the
---
> outer Composition, are assigned <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> in addition to their other <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">roles</span></code></a> in the
> nested Composition.  The only difference between <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> and <a class="reference internal" href="#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> Nodes
> is whether their output is included in the <a class="reference internal" href="#id23" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> attributes of the <em>outermost</em> Composition to which they project; this is determined by the
633c633
< <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes are <em>not</em> included in the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> or <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> for the outermost Composition to which they project (although they <em>are</em> still included
---
> <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes are <em>not</em> included in the <a class="reference internal" href="#id23" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> or <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositions.composition.Composition.results"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">results</span></code></a> for the outermost Composition to which they project (although they <em>are</em> still included
637c637
< <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.include_probes_in_output" title="psyneulink.core.compositions.composition.Composition.include_probes_in_output"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">include_probes_in_output</span></code></a> is True, then any <a class="reference internal" href="#id26" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes
---
> <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.include_probes_in_output" title="psyneulink.core.compositions.composition.Composition.include_probes_in_output"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">include_probes_in_output</span></code></a> is True, then any <a class="reference internal" href="#id28" title="psyneulink.core.compositions.composition.NodeRole.PROBE"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">PROBE</span></code></a> Nodes
639,640c639,640
< the <a class="reference internal" href="#id21" title="psyneulink.core.compositions.composition.Composition.output_values"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">output_values</span></code></a> and <a class="reference internal" href="#psyneulink.core.compositions.composition.Composition.results" title="psyneulink.core.compositio
...

See CI logs for the full diff.

path = Path(os.getcwd())
if filename:
# path = Path(path / filename)
path = Path(os.path.join(path / filename))
Copy link
Collaborator

Choose a reason for hiding this comment

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

path handling looks weird here. PosixPath only works on POSIX OSes so it shouldn't be used in portable code.
Using Path classes can directly use / operator and don't need os.path.join.
Using Path object constructor on the result is redundant as well since the result of the overloaded operation is already a Path object.

If using os.path.join, the components should be provided as arguments (e.g. os.path.join('dir', 'filename') and using Path object is redundant.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 9, 2022

This pull request introduces 1 alert and fixes 1 when merging c8d2825 into e741055 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

fixed alerts:

  • 1 for Unreachable code

@coveralls
Copy link

coveralls commented Nov 9, 2022

Coverage Status

Coverage decreased (-0.03%) to 84.168% when pulling c8d2825 on feat/autodiff_various into e741055 on devel.

@jdcpni jdcpni merged commit 786cdd9 into devel Nov 9, 2022
@jdcpni jdcpni deleted the feat/autodiff_various branch November 9, 2022 01:58
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.

4 participants