-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor/controlmech and ocm (#2186)
* • component.py docstring mod to **size** * • controlmechanism.py: add support for monitor_for_control in _instantiate_input_ports * - * • controlmechanism.py: refactoring to use outcome_input_ports_option * • controlmechanism.py: refactored to use outcome_input_ports following tests not passing: - control/test_param_estimation_test_moving_average (elfi) - test_json: test_json_results_equivalence (model_with_control_py-comp-{Input: [0.5, 0.123], reward: [20, 20]}) test_write_json_file (model_with_control_py-comp-{Input: [0.5, 0.123], reward: [20, 20]}) * - * - * - * - * - * Tests passing * • controlMechanism.py: - added outcome_input_ports_option: SEPARATE, COMBINE, CONCATENATE - refactored _outcome_getter to return value of all InputPorts in outcome_input_ports * - * • port.py: _instantiate_projection_from_port raise PortError if type_match fails for projection and parameter value during instantiation * • port.py: _instantiate_projection_from_port raise PortError if type_match fails for projection and parameter value during instantiation * • controlmechanism.py: fixed bugs in use of COMBINE and CONCATENATE * • controlmechanism.py: fixed more bugs in use of COMBINE and CONCATENATE * • optimizationcontrolmechanism.py: renamed evaluation_function -> evaluate_agent_rep * • optimizationfunctions.py: add aggregation_function as Parameter add num_estimates as argument for _function loop over num_estimates in call to _objective_function and use aggregation_function to aggregate results * • optimizationfunctions.py: add aggregation_function as Parameter add num_estimates as argument for _function loop over num_estimates in call to _objective_function and use aggregation_function to aggregate results * - * • optimizationfunctions.py: - implemented randomization_seed_dimension argument - implemented num_estimates property (uses randomization_seed_dimension) • optimizationcontrolmechanism.py: - validates that num_estimates (if specified) is consistent with number generated by allocation_samples for seed ControlSignal - passes randomization_seed_dimension to OptimizationFunction constructor * - * - * - * • tests/composition: add test_parameterestimationcomposition.py * • tests/composition: add test_parameterestimationcomposition.py (basic form) * - * - * - * - * • optimizationcontrolmechanism.py: moved construction of randomization ControlSignal here from PEC Passes all tests * - * - * • optimizationcontrolmechanism.py: renamed same_seed_for_all_parameter_combinations -> same_seed_for_all_allocations (left name the same on PEC for UI reasons) note: use of parameter by ObjectiveFunction remains to be implemented * • optimizationcontrolmechanism.py: docstring updates to reflect preceding changes * • optimizationcontrolmechanism.py: more docstring edits * - * - * - * - Co-authored-by: jdcpni <pniintel55>
- Loading branch information
Showing
17 changed files
with
940 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 88 additions & 15 deletions
103
psyneulink/core/components/functions/nonstateful/optimizationfunctions.py
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
264 changes: 194 additions & 70 deletions
264
psyneulink/core/components/mechanisms/modulatory/control/controlmechanism.py
Large diffs are not rendered by default.
Oops, something went wrong.
435 changes: 312 additions & 123 deletions
435
psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.