Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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]>
- Loading branch information