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

Parameters: allow _validate_ methods to reference other parameters #2512

Merged

Conversation

kmantel
Copy link
Collaborator

@kmantel kmantel commented Oct 27, 2022

No description provided.

@github-actions
Copy link

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

diff -r docs-base/Parameters.html docs-head/Parameters.html
300,301c300,306
< <li><p>if you want assignments to parameter <em>p</em> to be validated, add a method _validate_p(value),
< that returns None if value is a valid assignment, or an error string if value is not a valid assignment</p></li>
---
> <li><dl class="simple">
> <dt>if you want assignments to parameter <em>p</em> to be validated, add a method _validate_p(value),   that returns None if value is a valid assignment, or an error string if value is not a valid assignment</dt><dd><ul class="simple">
> <li><p>NOTE: a validation method for <em>p</em> may reference other parameters         only if they are listed in <em>p</em>’s         <a class="reference internal" href="#psyneulink.core.globals.parameters.Parameter.dependencies" title="psyneulink.core.globals.parameters.Parameter.dependencies"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">dependencies</span></code></a></p></li>
> </ul>
> </dd>
> </dl>
> </li>
311a317
> <li><p>NOTE: parsers may not reference other parameters</p></li>
diff -r docs-base/searchindex.js docs-head/searchindex.js
1c1
< Search.setIndex({docnames:["AGT","AGTControlMechanism","AutoAssociativeLearningMechanism","AutoAssociativeProjection","AutodiffComposition","BasicsAndPrimer","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","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:[12,0,0,"-"]},"psyneulink.core.components.component":{Component:[12,1,1,""]},"psyneulink.core.components.component.Component":{"function":[12,4,1,""],_check_args:[12,2,1,""],_check_for_composition:[12,2,1,""],_deferred_init:[12,2,1,""],_dependent_components:[12,3,1,""],_get_param_value_from_tuple:[12,2,1,""],_handle_default_variable:[12,2,1,""],_handle_size:[12,2,1,""],_instantiate_defaults:[12,2,1,""],_instantiate_function:[12,2,1,""],_instantiate_parameter_classes:[12,2,1,""],_model_spec_class_name_is_generic:[12,4,1,""],_model_spec_generic_type_name:[12,4,1,""],_model_spec_parameter_blacklist:[12,3,1,""],_parameter_components:[12,3,1,""],_parse_arg_generic:[12,2,1,""],_parse_arg_variable:[12,2,1,""],_parse_function_variable:[12,2,1,""],_set_multiple_parameter_values:[12,2,1,""],_specified_variable_shape_flexibility:[12,4,1,""],_validate:[12,2,1,""],_validate_and_assign_runtime_params:[12,2,1,""],_validate_function:[12,2,1,""],_validate_params:[12,2,1,""],_validate_variable:[12,2,1,""],all_dependent_parameters:[12,2,1,""],current_execution_time:[12,4,1,""],defaults:[12,4,1,""],execute:[12,2,1,""],execute_until_finished:[12,4,1,""],execution_count:[12,4,1,""],function_parameters:[12,3,1,""],initialization_status:[12,4,1,""],is_finished:[12,2,1,""],log:[12,4,1,""],log_values:[12,2,1,""],loggable_items:[12,3,1,""],logged_items:[12,3,1,""],max_executions_before_finished:[12,4,1,""],most_recent_context:[12,3,1,""],name:[12,4,1,""],num_executions:[12,4,1,""],num_executions_before_finished:[12,4,1,""],parameters:[12,4,1,""],prefs:[12,4,1,""],reset:[12,2,1,""],reset_params:[12,2,1,""],reset_stateful_function_when:[12,4,1,""],set_delivery_conditions:[12,2,1,""],set_log_conditions:[12,2,1,""],size:[12,4,1,""],stateful_parameters:[12,3,1,"id0"],value:[12,4,1,""],variable:[12,4,1,""]},"psyneulink.core.components.functions":{"function":[38,0,0,"-"],combinationfunctions:[9,0,0,"-"],distributionfunctions:[32,0,0,"-"],learningfunctions:[56,0,0,"-"],objectivefunctions:[78,0,0,"-"],optimizationfunctions:[82,0,0,"-"],selectionfunctions:[106,0,0,"-"],transferfunctions:[112,0,0,"-"],userdefinedfunction:[115,0,0,"-"]},"psyneulink.core.components.functions.combinationfunctions":{CombineMeans:[9,1,1,""],Concatenate:[9,1,1,""],LinearCombination:[9,1,1,""],PredictionErrorDeltaFunction:[9,1,1,""],Rearrange:[9,1,1,""],Reduce:[9,1,1,""]},"psyneulink.core.components.functions.combinationfunctions.CombineMeans":{_function:[9,2,1,""],_validate_params:[9,2,1,""],_validate_variable:[9,2,1,""],exponents:[9,4,1,""],name:[9,4,1,""],offset:[9,4,1,""],operation:[9,4,1,""],owner:[9,4,1,""],prefs:[9,4,1,""],scale:[9,4,1,""],variable:[9,4,1,""],weights:[9,4,1,""]},"psyneulink.core.components.functions.combinationfunctions.Concatenate":{_function:[9,2,1,""],_validate_params:[9,2,1,""],_validate_variable:[9,2,1,""],default_variable:[9,4,1,""],name:[9,4,1,""],offset:[9,4,1,""],owner:[9,4,1,""],prefs:[9,4,1,""],scale:[9,4,1,""]},"psyneulink.core.components.functions.combinationfunctions.LinearCombination":{_function:[9,2,1,""],_validate_params:[9,2,1,""],_validate_variable:[9,2,1,""],exponents:[9,4,1,""],name:[9,4,1,""],offset:[9,4,1,""],operation:[9,4,1,""],owner:[9,4,1,""],prefs:[9,4,1,""],scale:[9,4,1,""],variable:[9,4,1,""],weights:[9,4,1,""]},"psyneulink.core.components.functions.combinationfunctions.PredictionErrorDeltaFunction":{_function:[9,2,1,""],_validate_params:[9,2,1,""],_validate_variable:[9,2,1,""]},"psyneulink.core.components.functions.combinationfunctions.Rearrange":{_function:[9,2,1,""],_instantiate_attributes_before_function:[9,2,1,""],_validate_params:[9,2,1,""],_validate_variable:[9,2,1,""],arrangement:[9,4,1,""],default_variable:[9,4,1,""],name:[9,4,1,""],offset:[9,4,1,""],owner:[9,4,1,""],prefs:[9,4,1,""],scale:[9,4,1,""]},"psyneulink.core.components.functions.combinationfunctions.Reduce":{_function:[9,2,1,""],_validate_params:[9,2,1,""],_validate_variable:[9,2,1,""],default_variable:[9,4,1,""],name:[9,4,1,""],offset:[9,4,1,""],operation:[9,4,1,""],owner:[9,4,1,""],prefs:[9,4,1,""],scale:[9,4,1,""]},"psyneulink.core.components.functions.distributionfunctions":{DistributionFunction:[32,1,1,""],DriftDiffusionAnalytical:[32,1,1,""],ExponentialDist:[32,1,1,""],GammaDist:[32,1,1,""],NormalDist:[32,1,1,""],UniformDist:[32,1,1,""],UniformToNormalDist:[32,1,1,""],WaldDist:[32,1,1,""]},"psyneulink.core.components.functions.distributionfunctions.DriftDiffusionAnalytical":{_compute_conditional_rt_moments:[32,2,1,""],_function:[32,2,1,""],bias:[32,4,1,""],derivative:[32,2,1,""],drift_rate:[32,4,1,""],name:[32,4,1,""],noise:[32,4,1,""],non_decision_time:[32,4,1,""],owner:[32,4,1,""],prefs:[32,4,1,""],shenhav_et_al_compat_mode:[32,3,1,""],starting_value:[32,4,1,""],threshold:[32,4,1,""],variable:[32,4,1,""]},"psyneulink.core.components.functions.distributionfunctions.ExponentialDist":{beta:[32,4,1,""],name:[32,4,1,""],owner:[32,4,1,""],params:[32,4,1,""],prefs:[32,4,1,""],random_state:[32,4,1,""]},"psyneulink.core.components.functions.distributionfunctions.GammaDist":{dist_shape:[32,4,1,""],name:[32,4,1,""],owner:[32,4,1,""],params:[32,4,1,""],prefs:[32,4,1,""],random_state:[32,4,1,""],scale:[32,4,1,""]},"psyneulink.core.components.functions.distributionfunctions.NormalDist":{_validate_params:[32,2,1,""],mean:[32,4,1,""],name:[32,4,1,""],owner:[32,4,1,""],params:[32,4,1,""],prefs:[32,4,1,""],random_state:[32,4,1,""],standard_deviation:[32,4,1,""]},"psyneulink.core.components.functions.distributionfunctions.UniformDist":{high:[32,4,1,""],low:[32,4,1,""],name:[32,4,1,""],owner:[32,4,1,""],params:[32,4,1,""],prefs:[32,4,1,""],random_state:[32,4,1,""]},"psyneulink.core.components.functions.distributionfunctions.UniformToNormalDist":{mean:[32,4,1,""],name:[32,4,1,""],owner:[32,4,1,""],params:[32,4,1,""],prefs:[32,4,1,""],random_state:[32,4,1,""],standard_deviation:[32,4,1,""]},"psyneulink.core.components.functions.function":{ArgumentTherapy:[38,1,1,""],Function_Base:[38,1,1,""]},"psyneulink.core.components.functions.function.ArgumentTherapy":{Manner:[38,1,1,""],_function:[38,2,1,""],_validate_params:[38,2,1,""],_validate_variable:[38,2,1,""],name:[38,4,1,""],owner:[38,4,1,""],pertinacity:[38,4,1,""],prefs:[38,4,1,""],propensity:[38,4,1,""],variable:[38,4,1,""]},"psyneulink.core.components.functions.function.Function_Base":{"function":[38,4,1,""],_assign_to_mdf_model:[38,2,1,""],_model_spec_parameter_blacklist:[38,3,1,""],_parse_arg_generic:[38,2,1,""],_validate_parameter_spec:[38,2,1,""],name:[38,4,1,""],owner:[38,4,1,""],prefs:[38,4,1,""],variable:[38,4,1,""]},"psyneulink.core.components.functions.learningfunctions":{BackPropagation:[56,1,1,""],BayesGLM:[56,1,1,""],ContrastiveHebbian:[56,1,1,""],Hebbian:[56,1,1,""],Kohonen:[56,1,1,""],LearningFunction:[56,1,1,""],Reinforcement:[56,1,1,""],TDLearning:[56,1,1,""]},"psyneulink.core.components.functions.learningfunctions.BackPropagation":{_function:[56,2,1,""],_validate_params:[56,2,1,""],_validate_variable:[56,2,1,""],activation_derivative_fct:[56,4,1,""],activation_input:[56,4,1,""],activation_output:[56,4,1,""],default_learning_rate:[56,4,1,""],error_matrix:[56,4,1,""],error_signal:[56,4,1,""],learning_rate:[56,4,1,""],loss_function:[56,4,1,""],owner:[56,4,1,""],prefs:[56,4,1,""],variable:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.BayesGLM":{Lambda_n:[56,4,1,""],Lambda_prior:[56,4,1,""],_function:[56,2,1,""],_handle_default_variable:[56,2,1,""],gamma_shape_0:[56,4,1,""],gamma_shape_n:[56,4,1,""],gamma_shape_prior:[56,4,1,""],gamma_size_0:[56,4,1,""],gamma_size_n:[56,4,1,""],gamma_size_prior:[56,4,1,""],initialize_priors:[56,2,1,""],mu_0:[56,4,1,""],mu_n:[56,4,1,""],mu_prior:[56,4,1,""],owner:[56,4,1,""],prefs:[56,4,1,""],random_state:[56,4,1,""],reset:[56,2,1,""],sample_weights:[56,2,1,""],sigma_0:[56,4,1,""],variable:[56,4,1,""],weights_sample:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.ContrastiveHebbian":{"function":[56,4,1,""],_function:[56,2,1,""],_validate_params:[56,2,1,""],_validate_variable:[56,2,1,""],default_learning_rate:[56,4,1,""],learning_rate:[56,4,1,""],owner:[56,4,1,""],prefs:[56,4,1,""],variable:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.Hebbian":{"function":[56,4,1,""],_function:[56,2,1,""],_validate_params:[56,2,1,""],_validate_variable:[56,2,1,""],default_learning_rate:[56,4,1,""],learning_rate:[56,4,1,""],owner:[56,4,1,""],prefs:[56,4,1,""],variable:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.Kohonen":{"function":[56,4,1,""],_function:[56,2,1,""],_validate_params:[56,2,1,""],_validate_variable:[56,2,1,""],default_learning_rate:[56,4,1,""],learning_rate:[56,4,1,""],owner:[56,4,1,""],prefs:[56,4,1,""],variable:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.LearningFunction":{default_learning_rate:[56,4,1,""],learning_rate:[56,4,1,""],variable:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.Reinforcement":{"function":[56,4,1,""],_function:[56,2,1,""],_validate_params:[56,2,1,""],_validate_variable:[56,2,1,""],activation_input:[56,4,1,""],activation_output:[56,4,1,""],default_learning_rate:[56,4,1,""],error_signal:[56,4,1,""],learning_rate:[56,4,1,""],owner:[56,4,1,""],prefs:[56,4,1,""],variable:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.TDLearning":{_validate_variable:[56,2,1,""]},"psyneulink.core.components.functions.objectivefunctions":{Distance:[78,1,1,""],Energy:[78,1,1,""],Entropy:[78,1,1,""],ObjectiveFunction:[78,1,1,""],Stability:[78,1,1,""]},"psyneulink.core.components.functions.objectivefunctions.Distance":{_function:[78,2,1,""],_validate_params:[78,2,1,""],metric:[78,4,1,""],normalize:[78,4,1,""],owner:[78,4,1,""],params:[78,4,1,""],prefs:[78,4,1,""],variable:[78,4,1,""]},"psyneulink.core.components.functions.objectivefunctions.Energy":{matrix:[78,4,1,""],normalize:[78,4,1,""],owner:[78,4,1,""],p
...

See CI logs for the full diff.

@kmantel kmantel force-pushed the parameter-validation-order branch from 7b71862 to 0f7374a Compare October 28, 2022 03:24
@github-actions
Copy link

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

diff -r docs-base/Parameters.html docs-head/Parameters.html
300,301c300,306
< <li><p>if you want assignments to parameter <em>p</em> to be validated, add a method _validate_p(value),
< that returns None if value is a valid assignment, or an error string if value is not a valid assignment</p></li>
---
> <li><dl class="simple">
> <dt>if you want assignments to parameter <em>p</em> to be validated, add a method _validate_p(value),   that returns None if value is a valid assignment, or an error string if value is not a valid assignment</dt><dd><ul class="simple">
> <li><p>NOTE: a validation method for <em>p</em> may reference other parameters         only if they are listed in <em>p</em>’s         <a class="reference internal" href="#psyneulink.core.globals.parameters.Parameter.dependencies" title="psyneulink.core.globals.parameters.Parameter.dependencies"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">dependencies</span></code></a></p></li>
> </ul>
> </dd>
> </dl>
> </li>
311a317
> <li><p>NOTE: parsers may not reference other parameters</p></li>
diff -r docs-base/searchindex.js docs-head/searchindex.js
1c1
< Search.setIndex({docnames:["AGT","AGTControlMechanism","AutoAssociativeLearningMechanism","AutoAssociativeProjection","AutodiffComposition","BasicsAndPrimer","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","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:[12,0,0,"-"]},"psyneulink.core.components.component":{Component:[12,1,1,""]},"psyneulink.core.components.component.Component":{"function":[12,4,1,""],_check_args:[12,2,1,""],_check_for_composition:[12,2,1,""],_deferred_init:[12,2,1,""],_dependent_components:[12,3,1,""],_get_param_value_from_tuple:[12,2,1,""],_handle_default_variable:[12,2,1,""],_handle_size:[12,2,1,""],_instantiate_defaults:[12,2,1,""],_instantiate_function:[12,2,1,""],_instantiate_parameter_classes:[12,2,1,""],_model_spec_class_name_is_generic:[12,4,1,""],_model_spec_generic_type_name:[12,4,1,""],_model_spec_parameter_blacklist:[12,3,1,""],_parameter_components:[12,3,1,""],_parse_arg_generic:[12,2,1,""],_parse_arg_variable:[12,2,1,""],_parse_function_variable:[12,2,1,""],_set_multiple_parameter_values:[12,2,1,""],_specified_variable_shape_flexibility:[12,4,1,""],_validate:[12,2,1,""],_validate_and_assign_runtime_params:[12,2,1,""],_validate_function:[12,2,1,""],_validate_params:[12,2,1,""],_validate_variable:[12,2,1,""],all_dependent_parameters:[12,2,1,""],current_execution_time:[12,4,1,""],defaults:[12,4,1,""],execute:[12,2,1,""],execute_until_finished:[12,4,1,""],execution_count:[12,4,1,""],function_parameters:[12,3,1,""],initialization_status:[12,4,1,""],is_finished:[12,2,1,""],log:[12,4,1,""],log_values:[12,2,1,""],loggable_items:[12,3,1,""],logged_items:[12,3,1,""],max_executions_before_finished:[12,4,1,""],most_recent_context:[12,3,1,""],name:[12,4,1,""],num_executions:[12,4,1,""],num_executions_before_finished:[12,4,1,""],parameters:[12,4,1,""],prefs:[12,4,1,""],reset:[12,2,1,""],reset_params:[12,2,1,""],reset_stateful_function_when:[12,4,1,""],set_delivery_conditions:[12,2,1,""],set_log_conditions:[12,2,1,""],size:[12,4,1,""],stateful_parameters:[12,3,1,"id0"],value:[12,4,1,""],variable:[12,4,1,""]},"psyneulink.core.components.functions":{"function":[38,0,0,"-"],combinationfunctions:[9,0,0,"-"],distributionfunctions:[32,0,0,"-"],learningfunctions:[56,0,0,"-"],objectivefunctions:[78,0,0,"-"],optimizationfunctions:[82,0,0,"-"],selectionfunctions:[106,0,0,"-"],transferfunctions:[112,0,0,"-"],userdefinedfunction:[115,0,0,"-"]},"psyneulink.core.components.functions.combinationfunctions":{CombineMeans:[9,1,1,""],Concatenate:[9,1,1,""],LinearCombination:[9,1,1,""],PredictionErrorDeltaFunction:[9,1,1,""],Rearrange:[9,1,1,""],Reduce:[9,1,1,""]},"psyneulink.core.components.functions.combinationfunctions.CombineMeans":{_function:[9,2,1,""],_validate_params:[9,2,1,""],_validate_variable:[9,2,1,""],exponents:[9,4,1,""],name:[9,4,1,""],offset:[9,4,1,""],operation:[9,4,1,""],owner:[9,4,1,""],prefs:[9,4,1,""],scale:[9,4,1,""],variable:[9,4,1,""],weights:[9,4,1,""]},"psyneulink.core.components.functions.combinationfunctions.Concatenate":{_function:[9,2,1,""],_validate_params:[9,2,1,""],_validate_variable:[9,2,1,""],default_variable:[9,4,1,""],name:[9,4,1,""],offset:[9,4,1,""],owner:[9,4,1,""],prefs:[9,4,1,""],scale:[9,4,1,""]},"psyneulink.core.components.functions.combinationfunctions.LinearCombination":{_function:[9,2,1,""],_validate_params:[9,2,1,""],_validate_variable:[9,2,1,""],exponents:[9,4,1,""],name:[9,4,1,""],offset:[9,4,1,""],operation:[9,4,1,""],owner:[9,4,1,""],prefs:[9,4,1,""],scale:[9,4,1,""],variable:[9,4,1,""],weights:[9,4,1,""]},"psyneulink.core.components.functions.combinationfunctions.PredictionErrorDeltaFunction":{_function:[9,2,1,""],_validate_params:[9,2,1,""],_validate_variable:[9,2,1,""]},"psyneulink.core.components.functions.combinationfunctions.Rearrange":{_function:[9,2,1,""],_instantiate_attributes_before_function:[9,2,1,""],_validate_params:[9,2,1,""],_validate_variable:[9,2,1,""],arrangement:[9,4,1,""],default_variable:[9,4,1,""],name:[9,4,1,""],offset:[9,4,1,""],owner:[9,4,1,""],prefs:[9,4,1,""],scale:[9,4,1,""]},"psyneulink.core.components.functions.combinationfunctions.Reduce":{_function:[9,2,1,""],_validate_params:[9,2,1,""],_validate_variable:[9,2,1,""],default_variable:[9,4,1,""],name:[9,4,1,""],offset:[9,4,1,""],operation:[9,4,1,""],owner:[9,4,1,""],prefs:[9,4,1,""],scale:[9,4,1,""]},"psyneulink.core.components.functions.distributionfunctions":{DistributionFunction:[32,1,1,""],DriftDiffusionAnalytical:[32,1,1,""],ExponentialDist:[32,1,1,""],GammaDist:[32,1,1,""],NormalDist:[32,1,1,""],UniformDist:[32,1,1,""],UniformToNormalDist:[32,1,1,""],WaldDist:[32,1,1,""]},"psyneulink.core.components.functions.distributionfunctions.DriftDiffusionAnalytical":{_compute_conditional_rt_moments:[32,2,1,""],_function:[32,2,1,""],bias:[32,4,1,""],derivative:[32,2,1,""],drift_rate:[32,4,1,""],name:[32,4,1,""],noise:[32,4,1,""],non_decision_time:[32,4,1,""],owner:[32,4,1,""],prefs:[32,4,1,""],shenhav_et_al_compat_mode:[32,3,1,""],starting_value:[32,4,1,""],threshold:[32,4,1,""],variable:[32,4,1,""]},"psyneulink.core.components.functions.distributionfunctions.ExponentialDist":{beta:[32,4,1,""],name:[32,4,1,""],owner:[32,4,1,""],params:[32,4,1,""],prefs:[32,4,1,""],random_state:[32,4,1,""]},"psyneulink.core.components.functions.distributionfunctions.GammaDist":{dist_shape:[32,4,1,""],name:[32,4,1,""],owner:[32,4,1,""],params:[32,4,1,""],prefs:[32,4,1,""],random_state:[32,4,1,""],scale:[32,4,1,""]},"psyneulink.core.components.functions.distributionfunctions.NormalDist":{_validate_params:[32,2,1,""],mean:[32,4,1,""],name:[32,4,1,""],owner:[32,4,1,""],params:[32,4,1,""],prefs:[32,4,1,""],random_state:[32,4,1,""],standard_deviation:[32,4,1,""]},"psyneulink.core.components.functions.distributionfunctions.UniformDist":{high:[32,4,1,""],low:[32,4,1,""],name:[32,4,1,""],owner:[32,4,1,""],params:[32,4,1,""],prefs:[32,4,1,""],random_state:[32,4,1,""]},"psyneulink.core.components.functions.distributionfunctions.UniformToNormalDist":{mean:[32,4,1,""],name:[32,4,1,""],owner:[32,4,1,""],params:[32,4,1,""],prefs:[32,4,1,""],random_state:[32,4,1,""],standard_deviation:[32,4,1,""]},"psyneulink.core.components.functions.function":{ArgumentTherapy:[38,1,1,""],Function_Base:[38,1,1,""]},"psyneulink.core.components.functions.function.ArgumentTherapy":{Manner:[38,1,1,""],_function:[38,2,1,""],_validate_params:[38,2,1,""],_validate_variable:[38,2,1,""],name:[38,4,1,""],owner:[38,4,1,""],pertinacity:[38,4,1,""],prefs:[38,4,1,""],propensity:[38,4,1,""],variable:[38,4,1,""]},"psyneulink.core.components.functions.function.Function_Base":{"function":[38,4,1,""],_assign_to_mdf_model:[38,2,1,""],_model_spec_parameter_blacklist:[38,3,1,""],_parse_arg_generic:[38,2,1,""],_validate_parameter_spec:[38,2,1,""],name:[38,4,1,""],owner:[38,4,1,""],prefs:[38,4,1,""],variable:[38,4,1,""]},"psyneulink.core.components.functions.learningfunctions":{BackPropagation:[56,1,1,""],BayesGLM:[56,1,1,""],ContrastiveHebbian:[56,1,1,""],Hebbian:[56,1,1,""],Kohonen:[56,1,1,""],LearningFunction:[56,1,1,""],Reinforcement:[56,1,1,""],TDLearning:[56,1,1,""]},"psyneulink.core.components.functions.learningfunctions.BackPropagation":{_function:[56,2,1,""],_validate_params:[56,2,1,""],_validate_variable:[56,2,1,""],activation_derivative_fct:[56,4,1,""],activation_input:[56,4,1,""],activation_output:[56,4,1,""],default_learning_rate:[56,4,1,""],error_matrix:[56,4,1,""],error_signal:[56,4,1,""],learning_rate:[56,4,1,""],loss_function:[56,4,1,""],owner:[56,4,1,""],prefs:[56,4,1,""],variable:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.BayesGLM":{Lambda_n:[56,4,1,""],Lambda_prior:[56,4,1,""],_function:[56,2,1,""],_handle_default_variable:[56,2,1,""],gamma_shape_0:[56,4,1,""],gamma_shape_n:[56,4,1,""],gamma_shape_prior:[56,4,1,""],gamma_size_0:[56,4,1,""],gamma_size_n:[56,4,1,""],gamma_size_prior:[56,4,1,""],initialize_priors:[56,2,1,""],mu_0:[56,4,1,""],mu_n:[56,4,1,""],mu_prior:[56,4,1,""],owner:[56,4,1,""],prefs:[56,4,1,""],random_state:[56,4,1,""],reset:[56,2,1,""],sample_weights:[56,2,1,""],sigma_0:[56,4,1,""],variable:[56,4,1,""],weights_sample:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.ContrastiveHebbian":{"function":[56,4,1,""],_function:[56,2,1,""],_validate_params:[56,2,1,""],_validate_variable:[56,2,1,""],default_learning_rate:[56,4,1,""],learning_rate:[56,4,1,""],owner:[56,4,1,""],prefs:[56,4,1,""],variable:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.Hebbian":{"function":[56,4,1,""],_function:[56,2,1,""],_validate_params:[56,2,1,""],_validate_variable:[56,2,1,""],default_learning_rate:[56,4,1,""],learning_rate:[56,4,1,""],owner:[56,4,1,""],prefs:[56,4,1,""],variable:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.Kohonen":{"function":[56,4,1,""],_function:[56,2,1,""],_validate_params:[56,2,1,""],_validate_variable:[56,2,1,""],default_learning_rate:[56,4,1,""],learning_rate:[56,4,1,""],owner:[56,4,1,""],prefs:[56,4,1,""],variable:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.LearningFunction":{default_learning_rate:[56,4,1,""],learning_rate:[56,4,1,""],variable:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.Reinforcement":{"function":[56,4,1,""],_function:[56,2,1,""],_validate_params:[56,2,1,""],_validate_variable:[56,2,1,""],activation_input:[56,4,1,""],activation_output:[56,4,1,""],default_learning_rate:[56,4,1,""],error_signal:[56,4,1,""],learning_rate:[56,4,1,""],owner:[56,4,1,""],prefs:[56,4,1,""],variable:[56,4,1,""]},"psyneulink.core.components.functions.learningfunctions.TDLearning":{_validate_variable:[56,2,1,""]},"psyneulink.core.components.functions.objectivefunctions":{Distance:[78,1,1,""],Energy:[78,1,1,""],Entropy:[78,1,1,""],ObjectiveFunction:[78,1,1,""],Stability:[78,1,1,""]},"psyneulink.core.components.functions.objectivefunctions.Distance":{_function:[78,2,1,""],_validate_params:[78,2,1,""],metric:[78,4,1,""],normalize:[78,4,1,""],owner:[78,4,1,""],params:[78,4,1,""],prefs:[78,4,1,""],variable:[78,4,1,""]},"psyneulink.core.components.functions.objectivefunctions.Energy":{matrix:[78,4,1,""],normalize:[78,4,1,""],owner:[78,4,1,""],p
...

See CI logs for the full diff.

@kmantel kmantel merged commit 9129680 into PrincetonUniversity:devel Oct 28, 2022
jdcpni added a commit that referenced this pull request Oct 29, 2022
* • compositioninterfacemechanism.py:
  - _get_source_node_for_input_CIM:
        restore (modeled on _get_source_of_modulation_for_parameter_CIM) but NEEDS TESTS
  - _get_source_of_modulation_for_parameter_CIM: clean up comments, NEEDS TESTS

* -

* -

* -

* -

* -

* -

* • Nback
  - EM uses ContentAddressableMemory (instead of DictionaryMemory)
  - Implements FFN for comparison of current and retrieved stimulus and context

• Project:
  replace all instances of "RETREIVE" with "RETRIEVE"

* • objectivefunctions.py
  - add cosine_similarity (needs compiled version)

* • Project: make COSINE_SIMILARITY a synonym of COSINE
• nback_CAM_FFN:
  - refactor to implement FFN and task input
  - assign termination condition for execution that is dependent on control
  - ContentAddressableMemory: selection_function=SoftMax(output=MAX_INDICATOR,
                                                            gain=SOFT_MAX_TEMP)
• DriftOnASphereIntegrator:
  - add dimension as dependency for initializer parameter

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • test_integrator.py:
  Added identicalness test for DriftOnASphereIntegrator agains nback-paper implementation.

* -

* -

* Parameters: allow _validate_ methods to reference other parameters (#2512)

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • N-back.py:
  - added stimulus generation per nback-paper protocol

* - N-back.py
  tstep(s) -> trial(s)

* -

* -

* • N-back.py
  - comp -> nback_model
  - implement stim_set() method

* -

* • N-back.py:
  - added training set generation

* -

* -

* • N-back.py
  - modularized script

* -

* -

* -

* -

Co-authored-by: jdcpni <pniintel55>
Co-authored-by: Katherine Mantel <[email protected]>
jdcpni added a commit that referenced this pull request Nov 3, 2022
* • compositioninterfacemechanism.py:
  - _get_source_node_for_input_CIM:
        restore (modeled on _get_source_of_modulation_for_parameter_CIM) but NEEDS TESTS
  - _get_source_of_modulation_for_parameter_CIM: clean up comments, NEEDS TESTS

* -

* -

* -

* -

* -

* -

* • Nback
  - EM uses ContentAddressableMemory (instead of DictionaryMemory)
  - Implements FFN for comparison of current and retrieved stimulus and context

• Project:
  replace all instances of "RETREIVE" with "RETRIEVE"

* • objectivefunctions.py
  - add cosine_similarity (needs compiled version)

* • Project: make COSINE_SIMILARITY a synonym of COSINE
• nback_CAM_FFN:
  - refactor to implement FFN and task input
  - assign termination condition for execution that is dependent on control
  - ContentAddressableMemory: selection_function=SoftMax(output=MAX_INDICATOR,
                                                            gain=SOFT_MAX_TEMP)
• DriftOnASphereIntegrator:
  - add dimension as dependency for initializer parameter

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • test_integrator.py:
  Added identicalness test for DriftOnASphereIntegrator agains nback-paper implementation.

* -

* -

* Parameters: allow _validate_ methods to reference other parameters (#2512)

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • N-back.py:
  - added stimulus generation per nback-paper protocol

* - N-back.py
  tstep(s) -> trial(s)

* -

* -

* • N-back.py
  - comp -> nback_model
  - implement stim_set() method

* -

* • N-back.py:
  - added training set generation

* -

* -

* • N-back.py
  - modularized script

* -

* -

* -

* -

* • showgraph.py:
  - _assign_processing_components(): fix bug in which nested graphs not highlighted in animation.

* • showgraph.py * composition.py
  - add further description of animation, including note that animation of nested Compostions is limited.

* • showgraph.py * composition.py
  - add animation to N-back doc

* • autodiffcomposition.py
  - __init__(): move pathways arg to beginning, to capture positional assignment (i.e. w/o kw)

* -

* • N-back.py
  - ffn: implement as autodiff; still needs small random initial weight assignment

* • pathway.py
  - implement default_projection attribute

* • pathway.py
  - implement default_projection attribute

* • utilities.py:
  random_matrxi:  refactored to allow negative values and use keyword ZERO_CENTER

* • projection.py
  RandomMatrix: added class that can be used to pass a function as matrix spec

* • utilities.py
  - RandomMatrix moved here from projection.py

• function.py
  - get_matrix():  added support for RandomMatrix spec

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • utilities.py
  - is_matrix(): modified to support random_matrix and RandomMatrix

* • composition.py
  - add_linear_processing_pathway: add support for default_matrix argument
     (replaces default for MappingProjection for any otherwise unspecified projections)
     though still not used.

* -

* - RandomMatrix: moved from Utilities to Function

* -

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py
  - clean up script

* [skip ci]
• N-back.py
  - further script clean-up

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• BeukersNBackModel.rst:
  - Overview written
  - Needs other sections completed

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]

* -

* -

* [skip ci]

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• test_composition.py:
  - add test_pathway_tuple_specs()

* -

* -

* [skip ci]

* [skip ci]

* [skip ci]

* -

Co-authored-by: jdcpni <pniintel55>
Co-authored-by: Katherine Mantel <[email protected]>
jdcpni added a commit that referenced this pull request Nov 4, 2022
* • compositioninterfacemechanism.py:
  - _get_source_node_for_input_CIM:
        restore (modeled on _get_source_of_modulation_for_parameter_CIM) but NEEDS TESTS
  - _get_source_of_modulation_for_parameter_CIM: clean up comments, NEEDS TESTS

* -

* -

* -

* -

* -

* -

* • Nback
  - EM uses ContentAddressableMemory (instead of DictionaryMemory)
  - Implements FFN for comparison of current and retrieved stimulus and context

• Project:
  replace all instances of "RETREIVE" with "RETRIEVE"

* • objectivefunctions.py
  - add cosine_similarity (needs compiled version)

* • Project: make COSINE_SIMILARITY a synonym of COSINE
• nback_CAM_FFN:
  - refactor to implement FFN and task input
  - assign termination condition for execution that is dependent on control
  - ContentAddressableMemory: selection_function=SoftMax(output=MAX_INDICATOR,
                                                            gain=SOFT_MAX_TEMP)
• DriftOnASphereIntegrator:
  - add dimension as dependency for initializer parameter

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • test_integrator.py:
  Added identicalness test for DriftOnASphereIntegrator agains nback-paper implementation.

* -

* -

* Parameters: allow _validate_ methods to reference other parameters (#2512)

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • N-back.py:
  - added stimulus generation per nback-paper protocol

* - N-back.py
  tstep(s) -> trial(s)

* -

* -

* • N-back.py
  - comp -> nback_model
  - implement stim_set() method

* -

* • N-back.py:
  - added training set generation

* -

* -

* • N-back.py
  - modularized script

* -

* -

* -

* -

* • showgraph.py:
  - _assign_processing_components(): fix bug in which nested graphs not highlighted in animation.

* • showgraph.py * composition.py
  - add further description of animation, including note that animation of nested Compostions is limited.

* • showgraph.py * composition.py
  - add animation to N-back doc

* • autodiffcomposition.py
  - __init__(): move pathways arg to beginning, to capture positional assignment (i.e. w/o kw)

* -

* • N-back.py
  - ffn: implement as autodiff; still needs small random initial weight assignment

* • pathway.py
  - implement default_projection attribute

* • pathway.py
  - implement default_projection attribute

* • utilities.py:
  random_matrxi:  refactored to allow negative values and use keyword ZERO_CENTER

* • projection.py
  RandomMatrix: added class that can be used to pass a function as matrix spec

* • utilities.py
  - RandomMatrix moved here from projection.py

• function.py
  - get_matrix():  added support for RandomMatrix spec

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • utilities.py
  - is_matrix(): modified to support random_matrix and RandomMatrix

* • composition.py
  - add_linear_processing_pathway: add support for default_matrix argument
     (replaces default for MappingProjection for any otherwise unspecified projections)
     though still not used.

* -

* - RandomMatrix: moved from Utilities to Function

* -

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py
  - clean up script

* [skip ci]
• N-back.py
  - further script clean-up

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• BeukersNBackModel.rst:
  - Overview written
  - Needs other sections completed

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]

* -

* -

* [skip ci]

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• test_composition.py:
  - add test_pathway_tuple_specs()

* -

* -

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• composition.py:
  - add_linear_processing_pathway: fixed bug when Reinforcement or TDLearning are specified

• test_composition.py:
  - test_pathway_tuple_specs:  add tests for Reinforcement and TDLearning

* • composition.py:
  - add_linear_processing_pathway: fixed bug when Reinforcement or TDLearning are specified

• test_composition.py:
  - test_pathway_tuple_specs:  add tests for Reinforcement and TDLearning

Co-authored-by: jdcpni <pniintel55>
Co-authored-by: Katherine Mantel <[email protected]>
SamKG pushed a commit that referenced this pull request Nov 8, 2022
* • compositioninterfacemechanism.py:
  - _get_source_node_for_input_CIM:
        restore (modeled on _get_source_of_modulation_for_parameter_CIM) but NEEDS TESTS
  - _get_source_of_modulation_for_parameter_CIM: clean up comments, NEEDS TESTS

* -

* -

* -

* -

* -

* -

* • Nback
  - EM uses ContentAddressableMemory (instead of DictionaryMemory)
  - Implements FFN for comparison of current and retrieved stimulus and context

• Project:
  replace all instances of "RETREIVE" with "RETRIEVE"

* • objectivefunctions.py
  - add cosine_similarity (needs compiled version)

* • Project: make COSINE_SIMILARITY a synonym of COSINE
• nback_CAM_FFN:
  - refactor to implement FFN and task input
  - assign termination condition for execution that is dependent on control
  - ContentAddressableMemory: selection_function=SoftMax(output=MAX_INDICATOR,
                                                            gain=SOFT_MAX_TEMP)
• DriftOnASphereIntegrator:
  - add dimension as dependency for initializer parameter

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • test_integrator.py:
  Added identicalness test for DriftOnASphereIntegrator agains nback-paper implementation.

* -

* -

* Parameters: allow _validate_ methods to reference other parameters (#2512)

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • N-back.py:
  - added stimulus generation per nback-paper protocol

* - N-back.py
  tstep(s) -> trial(s)

* -

* -

* • N-back.py
  - comp -> nback_model
  - implement stim_set() method

* -

* • N-back.py:
  - added training set generation

* -

* -

* • N-back.py
  - modularized script

* -

* -

* -

* -

* • showgraph.py:
  - _assign_processing_components(): fix bug in which nested graphs not highlighted in animation.

* • showgraph.py * composition.py
  - add further description of animation, including note that animation of nested Compostions is limited.

* • showgraph.py * composition.py
  - add animation to N-back doc

* • autodiffcomposition.py
  - __init__(): move pathways arg to beginning, to capture positional assignment (i.e. w/o kw)

* -

* • N-back.py
  - ffn: implement as autodiff; still needs small random initial weight assignment

* • pathway.py
  - implement default_projection attribute

* • pathway.py
  - implement default_projection attribute

* • utilities.py:
  random_matrxi:  refactored to allow negative values and use keyword ZERO_CENTER

* • projection.py
  RandomMatrix: added class that can be used to pass a function as matrix spec

* • utilities.py
  - RandomMatrix moved here from projection.py

• function.py
  - get_matrix():  added support for RandomMatrix spec

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • utilities.py
  - is_matrix(): modified to support random_matrix and RandomMatrix

* • composition.py
  - add_linear_processing_pathway: add support for default_matrix argument
     (replaces default for MappingProjection for any otherwise unspecified projections)
     though still not used.

* -

* - RandomMatrix: moved from Utilities to Function

* -

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py
  - clean up script

* [skip ci]
• N-back.py
  - further script clean-up

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• BeukersNBackModel.rst:
  - Overview written
  - Needs other sections completed

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]

* -

* -

* [skip ci]

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• test_composition.py:
  - add test_pathway_tuple_specs()

* -

* -

* [skip ci]

* [skip ci]

* [skip ci]

* -

Co-authored-by: jdcpni <pniintel55>
Co-authored-by: Katherine Mantel <[email protected]>
SamKG pushed a commit that referenced this pull request Nov 8, 2022
* • compositioninterfacemechanism.py:
  - _get_source_node_for_input_CIM:
        restore (modeled on _get_source_of_modulation_for_parameter_CIM) but NEEDS TESTS
  - _get_source_of_modulation_for_parameter_CIM: clean up comments, NEEDS TESTS

* -

* -

* -

* -

* -

* -

* • Nback
  - EM uses ContentAddressableMemory (instead of DictionaryMemory)
  - Implements FFN for comparison of current and retrieved stimulus and context

• Project:
  replace all instances of "RETREIVE" with "RETRIEVE"

* • objectivefunctions.py
  - add cosine_similarity (needs compiled version)

* • Project: make COSINE_SIMILARITY a synonym of COSINE
• nback_CAM_FFN:
  - refactor to implement FFN and task input
  - assign termination condition for execution that is dependent on control
  - ContentAddressableMemory: selection_function=SoftMax(output=MAX_INDICATOR,
                                                            gain=SOFT_MAX_TEMP)
• DriftOnASphereIntegrator:
  - add dimension as dependency for initializer parameter

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • test_integrator.py:
  Added identicalness test for DriftOnASphereIntegrator agains nback-paper implementation.

* -

* -

* Parameters: allow _validate_ methods to reference other parameters (#2512)

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • N-back.py:
  - added stimulus generation per nback-paper protocol

* - N-back.py
  tstep(s) -> trial(s)

* -

* -

* • N-back.py
  - comp -> nback_model
  - implement stim_set() method

* -

* • N-back.py:
  - added training set generation

* -

* -

* • N-back.py
  - modularized script

* -

* -

* -

* -

* • showgraph.py:
  - _assign_processing_components(): fix bug in which nested graphs not highlighted in animation.

* • showgraph.py * composition.py
  - add further description of animation, including note that animation of nested Compostions is limited.

* • showgraph.py * composition.py
  - add animation to N-back doc

* • autodiffcomposition.py
  - __init__(): move pathways arg to beginning, to capture positional assignment (i.e. w/o kw)

* -

* • N-back.py
  - ffn: implement as autodiff; still needs small random initial weight assignment

* • pathway.py
  - implement default_projection attribute

* • pathway.py
  - implement default_projection attribute

* • utilities.py:
  random_matrxi:  refactored to allow negative values and use keyword ZERO_CENTER

* • projection.py
  RandomMatrix: added class that can be used to pass a function as matrix spec

* • utilities.py
  - RandomMatrix moved here from projection.py

• function.py
  - get_matrix():  added support for RandomMatrix spec

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • utilities.py
  - is_matrix(): modified to support random_matrix and RandomMatrix

* • composition.py
  - add_linear_processing_pathway: add support for default_matrix argument
     (replaces default for MappingProjection for any otherwise unspecified projections)
     though still not used.

* -

* - RandomMatrix: moved from Utilities to Function

* -

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py
  - clean up script

* [skip ci]
• N-back.py
  - further script clean-up

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• BeukersNBackModel.rst:
  - Overview written
  - Needs other sections completed

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]

* -

* -

* [skip ci]

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• test_composition.py:
  - add test_pathway_tuple_specs()

* -

* -

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• composition.py:
  - add_linear_processing_pathway: fixed bug when Reinforcement or TDLearning are specified

• test_composition.py:
  - test_pathway_tuple_specs:  add tests for Reinforcement and TDLearning

* • composition.py:
  - add_linear_processing_pathway: fixed bug when Reinforcement or TDLearning are specified

• test_composition.py:
  - test_pathway_tuple_specs:  add tests for Reinforcement and TDLearning

Co-authored-by: jdcpni <pniintel55>
Co-authored-by: Katherine Mantel <[email protected]>
jdcpni added a commit that referenced this pull request Nov 9, 2022
* Add autodiff save/load functionality

* -

* Update autodiffcomposition.py

* Update test_autodiffcomposition.py

* Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeuLink into devel

* • Autodiff:
  - 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

* • Autodiff:
  - 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

* -

* -

* • pytorchcomponents.py:
  - pytorch_function_creator: add SoftMax

• transferfunctions.py:
  - disable changes to ReLU.derivative for now

* • utilities.py:
  - iscompatible:
    attempt to replace try and except, commented out for now

* -

* -

* • autodiffcomposition.py:
  - save and load: augment file and directory handling
  - exclude processing of any ModulatoryProjections

* -

* -

* -

* • autodiffcomposition.py
  save(): add projection.matrix.base = matrix
           (fixes test_autodiff_saveload)

* -

* • autodiffcomposition.py:
  - save: return path
• test_autodiffcomposition.py:
  - test_autodiff_saveload: modify to use current working directory rather than tmp

* • autodiffcomposition.py:
  - save() and load(): ignore CIM, learning, and other modulation-related projections

* • autodiffcomposition.py:
  - load(): change test for path (failing on Windows) from PosixPath to Path

* • autodiffcomposition.py:
  - 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

* -

* [skip ci]

* [skip ci]

* [skip ci]
• autodiffcomposition.py:
  load():  add testing for match of matrix shape

* [skip ci]
• N-back:
  - reset em after each run
  - save and load weights
  - torch epochs = batch size (number training stimuli) * num_epochs

* [skip ci]

* [skip ci]

* Feat/add pathway default matrix (#2518)

* • compositioninterfacemechanism.py:
  - _get_source_node_for_input_CIM:
        restore (modeled on _get_source_of_modulation_for_parameter_CIM) but NEEDS TESTS
  - _get_source_of_modulation_for_parameter_CIM: clean up comments, NEEDS TESTS

* -

* -

* -

* -

* -

* -

* • Nback
  - EM uses ContentAddressableMemory (instead of DictionaryMemory)
  - Implements FFN for comparison of current and retrieved stimulus and context

• Project:
  replace all instances of "RETREIVE" with "RETRIEVE"

* • objectivefunctions.py
  - add cosine_similarity (needs compiled version)

* • Project: make COSINE_SIMILARITY a synonym of COSINE
• nback_CAM_FFN:
  - refactor to implement FFN and task input
  - assign termination condition for execution that is dependent on control
  - ContentAddressableMemory: selection_function=SoftMax(output=MAX_INDICATOR,
                                                            gain=SOFT_MAX_TEMP)
• DriftOnASphereIntegrator:
  - add dimension as dependency for initializer parameter

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • test_integrator.py:
  Added identicalness test for DriftOnASphereIntegrator agains nback-paper implementation.

* -

* -

* Parameters: allow _validate_ methods to reference other parameters (#2512)

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • N-back.py:
  - added stimulus generation per nback-paper protocol

* - N-back.py
  tstep(s) -> trial(s)

* -

* -

* • N-back.py
  - comp -> nback_model
  - implement stim_set() method

* -

* • N-back.py:
  - added training set generation

* -

* -

* • N-back.py
  - modularized script

* -

* -

* -

* -

* • showgraph.py:
  - _assign_processing_components(): fix bug in which nested graphs not highlighted in animation.

* • showgraph.py * composition.py
  - add further description of animation, including note that animation of nested Compostions is limited.

* • showgraph.py * composition.py
  - add animation to N-back doc

* • autodiffcomposition.py
  - __init__(): move pathways arg to beginning, to capture positional assignment (i.e. w/o kw)

* -

* • N-back.py
  - ffn: implement as autodiff; still needs small random initial weight assignment

* • pathway.py
  - implement default_projection attribute

* • pathway.py
  - implement default_projection attribute

* • utilities.py:
  random_matrxi:  refactored to allow negative values and use keyword ZERO_CENTER

* • projection.py
  RandomMatrix: added class that can be used to pass a function as matrix spec

* • utilities.py
  - RandomMatrix moved here from projection.py

• function.py
  - get_matrix():  added support for RandomMatrix spec

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • utilities.py
  - is_matrix(): modified to support random_matrix and RandomMatrix

* • composition.py
  - add_linear_processing_pathway: add support for default_matrix argument
     (replaces default for MappingProjection for any otherwise unspecified projections)
     though still not used.

* -

* - RandomMatrix: moved from Utilities to Function

* -

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py
  - clean up script

* [skip ci]
• N-back.py
  - further script clean-up

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• BeukersNBackModel.rst:
  - Overview written
  - Needs other sections completed

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]

* -

* -

* [skip ci]

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• test_composition.py:
  - add test_pathway_tuple_specs()

* -

* -

* [skip ci]

* [skip ci]

* [skip ci]

* -

Co-authored-by: jdcpni <pniintel55>
Co-authored-by: Katherine Mantel <[email protected]>

* Feat/add pathway default matrix (#2519)

* • compositioninterfacemechanism.py:
  - _get_source_node_for_input_CIM:
        restore (modeled on _get_source_of_modulation_for_parameter_CIM) but NEEDS TESTS
  - _get_source_of_modulation_for_parameter_CIM: clean up comments, NEEDS TESTS

* -

* -

* -

* -

* -

* -

* • Nback
  - EM uses ContentAddressableMemory (instead of DictionaryMemory)
  - Implements FFN for comparison of current and retrieved stimulus and context

• Project:
  replace all instances of "RETREIVE" with "RETRIEVE"

* • objectivefunctions.py
  - add cosine_similarity (needs compiled version)

* • Project: make COSINE_SIMILARITY a synonym of COSINE
• nback_CAM_FFN:
  - refactor to implement FFN and task input
  - assign termination condition for execution that is dependent on control
  - ContentAddressableMemory: selection_function=SoftMax(output=MAX_INDICATOR,
                                                            gain=SOFT_MAX_TEMP)
• DriftOnASphereIntegrator:
  - add dimension as dependency for initializer parameter

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • test_integrator.py:
  Added identicalness test for DriftOnASphereIntegrator agains nback-paper implementation.

* -

* -

* Parameters: allow _validate_ methods to reference other parameters (#2512)

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • N-back.py:
  - added stimulus generation per nback-paper protocol

* - N-back.py
  tstep(s) -> trial(s)

* -

* -

* • N-back.py
  - comp -> nback_model
  - implement stim_set() method

* -

* • N-back.py:
  - added training set generation

* -

* -

* • N-back.py
  - modularized script

* -

* -

* -

* -

* • showgraph.py:
  - _assign_processing_components(): fix bug in which nested graphs not highlighted in animation.

* • showgraph.py * composition.py
  - add further description of animation, including note that animation of nested Compostions is limited.

* • showgraph.py * composition.py
  - add animation to N-back doc

* • autodiffcomposition.py
  - __init__(): move pathways arg to beginning, to capture positional assignment (i.e. w/o kw)

* -

* • N-back.py
  - ffn: implement as autodiff; still needs small random initial weight assignment

* • pathway.py
  - implement default_projection attribute

* • pathway.py
  - implement default_projection attribute

* • utilities.py:
  random_matrxi:  refactored to allow negative values and use keyword ZERO_CENTER

* • projection.py
  RandomMatrix: added class that can be used to pass a function as matrix spec

* • utilities.py
  - RandomMatrix moved here from projection.py

• function.py
  - get_matrix():  added support for RandomMatrix spec

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • utilities.py
  - is_matrix(): modified to support random_matrix and RandomMatrix

* • composition.py
  - add_linear_processing_pathway: add support for default_matrix argument
     (replaces default for MappingProjection for any otherwise unspecified projections)
     though still not used.

* -

* - RandomMatrix: moved from Utilities to Function

* -

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py
  - clean up script

* [skip ci]
• N-back.py
  - further script clean-up

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• BeukersNBackModel.rst:
  - Overview written
  - Needs other sections completed

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]

* -

* -

* [skip ci]

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• test_composition.py:
  - add test_pathway_tuple_specs()

* -

* -

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• composition.py:
  - add_linear_processing_pathway: fixed bug when Reinforcement or TDLearning are specified

• test_composition.py:
  - test_pathway_tuple_specs:  add tests for Reinforcement and TDLearning

* • composition.py:
  - add_linear_processing_pathway: fixed bug when Reinforcement or TDLearning are specified

• test_composition.py:
  - test_pathway_tuple_specs:  add tests for Reinforcement and TDLearning

Co-authored-by: jdcpni <pniintel55>
Co-authored-by: Katherine Mantel <[email protected]>

* autodiff: Use most recent context while save/load

* tests/autodiff: Use portable path join

* autodiff: Add assertions for save/load

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* • autodiffcomposition, test_autodiff_saveload:
  - merged from feat/autodiff_save

* -

* -

* -

* • autodiffcomposition.py
  - fix path assignment bug

* -

Co-authored-by: SamKG <[email protected]>
Co-authored-by: Katherine Mantel <[email protected]>
jdcpni added a commit that referenced this pull request Nov 19, 2022
* Add autodiff save/load functionality

* -

* Update autodiffcomposition.py

* Update test_autodiffcomposition.py

* Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeuLink into devel

* • Autodiff:
  - 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

* • Autodiff:
  - 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

* -

* -

* • pytorchcomponents.py:
  - pytorch_function_creator: add SoftMax

• transferfunctions.py:
  - disable changes to ReLU.derivative for now

* • utilities.py:
  - iscompatible:
    attempt to replace try and except, commented out for now

* -

* -

* • autodiffcomposition.py:
  - save and load: augment file and directory handling
  - exclude processing of any ModulatoryProjections

* -

* -

* -

* • autodiffcomposition.py
  save(): add projection.matrix.base = matrix
           (fixes test_autodiff_saveload)

* -

* • autodiffcomposition.py:
  - save: return path
• test_autodiffcomposition.py:
  - test_autodiff_saveload: modify to use current working directory rather than tmp

* • autodiffcomposition.py:
  - save() and load(): ignore CIM, learning, and other modulation-related projections

* • autodiffcomposition.py:
  - load(): change test for path (failing on Windows) from PosixPath to Path

* • autodiffcomposition.py:
  - 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

* -

* [skip ci]

* [skip ci]

* [skip ci]
• autodiffcomposition.py:
  load():  add testing for match of matrix shape

* [skip ci]
• N-back:
  - reset em after each run
  - save and load weights
  - torch epochs = batch size (number training stimuli) * num_epochs

* [skip ci]

* [skip ci]

* Feat/add pathway default matrix (#2518)

* • compositioninterfacemechanism.py:
  - _get_source_node_for_input_CIM:
        restore (modeled on _get_source_of_modulation_for_parameter_CIM) but NEEDS TESTS
  - _get_source_of_modulation_for_parameter_CIM: clean up comments, NEEDS TESTS

* -

* -

* -

* -

* -

* -

* • Nback
  - EM uses ContentAddressableMemory (instead of DictionaryMemory)
  - Implements FFN for comparison of current and retrieved stimulus and context

• Project:
  replace all instances of "RETREIVE" with "RETRIEVE"

* • objectivefunctions.py
  - add cosine_similarity (needs compiled version)

* • Project: make COSINE_SIMILARITY a synonym of COSINE
• nback_CAM_FFN:
  - refactor to implement FFN and task input
  - assign termination condition for execution that is dependent on control
  - ContentAddressableMemory: selection_function=SoftMax(output=MAX_INDICATOR,
                                                            gain=SOFT_MAX_TEMP)
• DriftOnASphereIntegrator:
  - add dimension as dependency for initializer parameter

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • test_integrator.py:
  Added identicalness test for DriftOnASphereIntegrator agains nback-paper implementation.

* -

* -

* Parameters: allow _validate_ methods to reference other parameters (#2512)

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • N-back.py:
  - added stimulus generation per nback-paper protocol

* - N-back.py
  tstep(s) -> trial(s)

* -

* -

* • N-back.py
  - comp -> nback_model
  - implement stim_set() method

* -

* • N-back.py:
  - added training set generation

* -

* -

* • N-back.py
  - modularized script

* -

* -

* -

* -

* • showgraph.py:
  - _assign_processing_components(): fix bug in which nested graphs not highlighted in animation.

* • showgraph.py * composition.py
  - add further description of animation, including note that animation of nested Compostions is limited.

* • showgraph.py * composition.py
  - add animation to N-back doc

* • autodiffcomposition.py
  - __init__(): move pathways arg to beginning, to capture positional assignment (i.e. w/o kw)

* -

* • N-back.py
  - ffn: implement as autodiff; still needs small random initial weight assignment

* • pathway.py
  - implement default_projection attribute

* • pathway.py
  - implement default_projection attribute

* • utilities.py:
  random_matrxi:  refactored to allow negative values and use keyword ZERO_CENTER

* • projection.py
  RandomMatrix: added class that can be used to pass a function as matrix spec

* • utilities.py
  - RandomMatrix moved here from projection.py

• function.py
  - get_matrix():  added support for RandomMatrix spec

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • utilities.py
  - is_matrix(): modified to support random_matrix and RandomMatrix

* • composition.py
  - add_linear_processing_pathway: add support for default_matrix argument
     (replaces default for MappingProjection for any otherwise unspecified projections)
     though still not used.

* -

* - RandomMatrix: moved from Utilities to Function

* -

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py
  - clean up script

* [skip ci]
• N-back.py
  - further script clean-up

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• BeukersNBackModel.rst:
  - Overview written
  - Needs other sections completed

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]

* -

* -

* [skip ci]

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• test_composition.py:
  - add test_pathway_tuple_specs()

* -

* -

* [skip ci]

* [skip ci]

* [skip ci]

* -

Co-authored-by: jdcpni <pniintel55>
Co-authored-by: Katherine Mantel <[email protected]>

* Feat/add pathway default matrix (#2519)

* • compositioninterfacemechanism.py:
  - _get_source_node_for_input_CIM:
        restore (modeled on _get_source_of_modulation_for_parameter_CIM) but NEEDS TESTS
  - _get_source_of_modulation_for_parameter_CIM: clean up comments, NEEDS TESTS

* -

* -

* -

* -

* -

* -

* • Nback
  - EM uses ContentAddressableMemory (instead of DictionaryMemory)
  - Implements FFN for comparison of current and retrieved stimulus and context

• Project:
  replace all instances of "RETREIVE" with "RETRIEVE"

* • objectivefunctions.py
  - add cosine_similarity (needs compiled version)

* • Project: make COSINE_SIMILARITY a synonym of COSINE
• nback_CAM_FFN:
  - refactor to implement FFN and task input
  - assign termination condition for execution that is dependent on control
  - ContentAddressableMemory: selection_function=SoftMax(output=MAX_INDICATOR,
                                                            gain=SOFT_MAX_TEMP)
• DriftOnASphereIntegrator:
  - add dimension as dependency for initializer parameter

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • test_integrator.py:
  Added identicalness test for DriftOnASphereIntegrator agains nback-paper implementation.

* -

* -

* Parameters: allow _validate_ methods to reference other parameters (#2512)

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • Scripts:
  - Updated N-back to use objective_mechanism, with commented out code for version that doesn't use it once bug is fixed
  - Deleted N-back_WITH_OBJECTIVE_MECH.py

* • N-back.py:
  - added stimulus generation per nback-paper protocol

* - N-back.py
  tstep(s) -> trial(s)

* -

* -

* • N-back.py
  - comp -> nback_model
  - implement stim_set() method

* -

* • N-back.py:
  - added training set generation

* -

* -

* • N-back.py
  - modularized script

* -

* -

* -

* -

* • showgraph.py:
  - _assign_processing_components(): fix bug in which nested graphs not highlighted in animation.

* • showgraph.py * composition.py
  - add further description of animation, including note that animation of nested Compostions is limited.

* • showgraph.py * composition.py
  - add animation to N-back doc

* • autodiffcomposition.py
  - __init__(): move pathways arg to beginning, to capture positional assignment (i.e. w/o kw)

* -

* • N-back.py
  - ffn: implement as autodiff; still needs small random initial weight assignment

* • pathway.py
  - implement default_projection attribute

* • pathway.py
  - implement default_projection attribute

* • utilities.py:
  random_matrxi:  refactored to allow negative values and use keyword ZERO_CENTER

* • projection.py
  RandomMatrix: added class that can be used to pass a function as matrix spec

* • utilities.py
  - RandomMatrix moved here from projection.py

• function.py
  - get_matrix():  added support for RandomMatrix spec

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • port.py
  - _parse_port_spec(): added support for RandomMatrix

* • utilities.py
  - is_matrix(): modified to support random_matrix and RandomMatrix

* • composition.py
  - add_linear_processing_pathway: add support for default_matrix argument
     (replaces default for MappingProjection for any otherwise unspecified projections)
     though still not used.

* -

* - RandomMatrix: moved from Utilities to Function

* -

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py
  - clean up script

* [skip ci]
• N-back.py
  - further script clean-up

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• BeukersNBackModel.rst:
  - Overview written
  - Needs other sections completed

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]
• N-back.py:
  - replace functions of TransferMechanisms with ReLU
  - replace function of Decision Mechanisms with SoftMax
  - more doc cleanup

* [skip ci]

* -

* -

* [skip ci]

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• composition.py:
  implement default_projection_matrix in add_XXX_pathway() methods

* [skip ci]
• test_composition.py:
  - add test_pathway_tuple_specs()

* -

* -

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• composition.py:
  - add_linear_processing_pathway: fixed bug when Reinforcement or TDLearning are specified

• test_composition.py:
  - test_pathway_tuple_specs:  add tests for Reinforcement and TDLearning

* • composition.py:
  - add_linear_processing_pathway: fixed bug when Reinforcement or TDLearning are specified

• test_composition.py:
  - test_pathway_tuple_specs:  add tests for Reinforcement and TDLearning

Co-authored-by: jdcpni <pniintel55>
Co-authored-by: Katherine Mantel <[email protected]>

* autodiff: Use most recent context while save/load

* tests/autodiff: Use portable path join

* autodiff: Add assertions for save/load

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* • autodiffcomposition, test_autodiff_saveload:
  - merged from feat/autodiff_save

* -

* -

* -

* • autodiffcomposition.py
  - fix path assignment bug

* -

* • N-back mods

* • N-back: reimplementing get_run_inputs

* -

* -

* -

* -

* • N-back.py
  - refactoring of generate_stim_seq:
    continuous presentation of stimuli
    balancing of trial_types (with fill-in)
    return trial_type_seq

* [skip ci]

* Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeuLink into devel

� Conflicts:
�	psyneulink/library/compositions/autodiffcomposition.py

* Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeuLink into devel

� Conflicts:
�	psyneulink/library/compositions/autodiffcomposition.py

* [skip ci]

* [skip ci]
• N-back.py
  - docstring mods

* [skip ci]

* [skip ci]
• N-back.py:
  add Kane stimuli (2back)

* [skip ci]

* [skip ci]

* [skip ci]

* • N-back.py
  - add analyze_results()

* [skip ci]
• N-back.py
  - add analyze_results()

* [skip ci]
• N-back.py:
  - analyze_results: fully implemented

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• composition.py, pytorchmodelcreator.py
  - modify loss_spec to use keywords for loss

• Nback.py:
  - Autodiff loss_spec = CROSS_ENTROPY

* [skip ci]
• pytorchmodelcreator.py:
  - _gen_llvm_training_function_body():
    - add support for loss_type = CROSS_ENTROPY

• compiledloss.py:
  - _gen_loss_function:  add support for CROSS_ENTROPYLoss
     - needs to be debugged
     - need differential implemented

* [skip ci]

* [skip ci]

* [skip ci]
• composition.py:
  - _create_terminal_backprop_learning_components:
    - support loss_function = CROSS_ENTROPY

• combinationfunctions.py:
  - LinearCombination: add CROSS_ENTROPY as operation

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• transferfunctions.py:
  - ReLU: modified derivative to use infer input from output if provided (needed for BackPropagation)

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]

* -

* • transferfunctions.py:
  - SoftMax.derivative:  fixes
    NOTE: LLVM needs to be modified accordingly

• test_transfer.py:
  - test_transfer_derivative: modify tests to match changes to SoftMax
    NOTE:  LLVM tests don't pass

* [skip ci]

* [skip ci]

* [skip ci]
• composition.py
  - docstring mods re: Autodiff

* [skip ci]

* Merge branch 'nback' of https://github.com/PrincetonUniversity/PsyNeuLink into nback
� Conflicts:
�	Scripts/Models (Under Development)/Nback/nback.py

• composition.py:
  - run(): try addining Report context for LLVM execution

* [skip ci]
• composition.py
  - add Report for compiled mode

• compiledloss.py:
  - CROSS_ENTROPYLoss:
    _gen_loss_function():
       fixed bug, now runs
    _gen_inject_loss_differential():
      dummy copied from MSELoss -- NEEDS TO BE FIXED

• transferfunctions.py:
  - ReLU: added compiled support for derivative using output

• test_transfer.py:
  - test_transfer_derivative_out:
     test derivatives with output instead of input as arg

* Merge branch 'nback' of https://github.com/PrincetonUniversity/PsyNeuLink into nback
� Conflicts:
�	Scripts/Models (Under Development)/Nback/nback.py

• composition.py:
  - run(): try addining Report context for LLVM execution

* [skip ci]

* [skip ci]

* [skip ci]

* [skip ci]
• Merge branch 'nback' of https://github.com/PrincetonUniversity/PsyNeuLink into nback

• composition.py:
  - docstring mods regarding Autodiff learning

* [skip ci]

* • composition.py
  - more docstrings re: Autodiff

* [skip ci]
• composition.py
  - table for learning execution modes

* [skip ci]
• llvm/__init__.py
  - ExecuteMode: add PyTorch as synonym for Python

• autodiffcomposition.py
  - docstrring refactoring

* [skip ci]

* [skip ci]
• composition.py, autodiffcomposition.py
  - docstring mods

* [skip ci]
• composition.py, autodiffcomposition.py
  - docstring mods

* [skip ci]
• composition.py, autodiffcomposition.py
  - docstring mods

* [skip ci]

* [skip ci]
• test_transfer.py:
  - get rid of duplicative test

* Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeuLink into devel

 Conflicts:
	.github/actions/install-pnl/action.yml
	.github/actions/on-branch/action.yml
	.github/workflows/pnl-ci-docs.yml
	.github/workflows/pnl-ci.yml
	.github/workflows/test-release.yml
	Scripts/Models (Under Development)/N-back.py

* Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeuLink into devel

 Conflicts:
	.github/actions/install-pnl/action.yml
	.github/actions/on-branch/action.yml
	.github/workflows/pnl-ci-docs.yml
	.github/workflows/pnl-ci.yml
	.github/workflows/test-release.yml
	Scripts/Models (Under Development)/N-back.py

* • test_learning.py:
  - test_xor_training_identicalness_standard_composition_vs_PyTorch_vs_LLVM:
      replaces test_xor_training_identicalness_standard_composition_vs_Autodiff

* • learningfunctions.py
  - BackPropagation:
    - fix bug in which derivative for default loss (MSE) was computed using L0
    - add explicit specification for L0 loss

• composition.py:
  - _create_terminal_backprop_learning_components:
    - add explicit assignment of output_port[SUM] for L0 loss

• test_learning.py:
  - test_multilayer:
    - fix bug in which SSE was assigned as loss, but oputput_port[MSE] was used for objective_mechanism
    - replace with explicit L0 loss and ouput_port[SUM] for objective_mechanism

* [skip ci]
• learningfunctions.py
  - _create_non_terminal_backprop_learning_components:
    - fixed bug in which loss function for hidden layers was set to MSE rather than simple L0

* [skip ci]
• All tests pass

* [skip ci]
• test_learning.py:
  - test_multilayer_truth():  parameterize test with expected results

* [skip ci]
• test_learning.py:
  - test_multilayer_truth():  test for L0, SSE and MSE

* [skip ci]
• All tests pass

* [skip ci]
• All tests pass

* [skip ci]

* [skip ci]
• keywords.py
  - add Loss enum

• llvm.rst
  - add ExecutionMode

• Project
  - replace MSE, SSE, L0, L1, CROSS_ENTROPY, KL_DIV, NLL and POISSON_NLL with Loss enum members

* [skip ci]
• composition.py:
  - run(): add warning for use of PyTorch with Composition

* [skip ci]

* [skip ci]
• composition.py:
  - run(): commented out warning, as can't distinguish ExecutionMode.PyTorch from ExecutionMode.Python

* -

* • test_learning.py
  - clean up test_xor_training_identicalness_standard_composition_vs_PyTorch_and_LLVM

* • test_learning.py
  - clean up test_xor_training_identicalness_standard_composition_vs_PyTorch_and_LLVM

Co-authored-by: SamKG <[email protected]>
Co-authored-by: Katherine Mantel <[email protected]>
Co-authored-by: jdcpni <pniintel55>
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.

1 participant