-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fix/comp and mech/input variable #2310
Merged
Merged
Conversation
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
- _add_controller: modifying to instantiate feature_input_ports if none are specified
- add_controller: assign simulation_input_ports
- feature_input_ports -> state_input_ports - _instantiate_input_ports(): state_features only allowed to specifying state_input_ports if agent_rep is a CompositionFunctionApproximator (i.e., model-free optimization) • composition.py: - add_controller: adds state_input_ports to shadow INPUT Nodes of Composition if controller.agent_rep is Composition (model-based optimziation) or state_features have not been specified (for model-free optimizaton)
_instantiate_input_ports: reinstate allowance of state_features specification if agent_rep is a Composition (i.e., model-based optimization) as long as they are all INPUT Nodes of agent_rep
- _gen_llvm_evaluate_function: num_estimates -> num_estimates_per_trial
- _gen_llvm_evaluate_function: num_estimates -> num_trial_per_estimate
…rincetonUniversity/PsyNeuLink into refactor/ocm/state_input_ports � Conflicts: � psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py
- _gen_llvm_evaluate_function: num_estimates -> num_trials_per_estimate
…Link into refactor/ocm/state_input_ports
…ut_ports # Conflicts: # psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py
- __init__: moved controller instantiation until after nodes, projections and pathways
- __init__: restored add_controller position
…teger Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
…ut_ports # Conflicts: # psyneulink/core/llvm/builder_context.py
…Link into refactor/ocm/state_input_ports
- _update_controller: added - add_controller and _analyze_graph(): call _update_controller
_update_controller: fixed to loop through all input_ports of comp INPUT nodes
…Link into feat/comp/get_input_format_template
- add external_input_variables properties - add get_input_variables() methods replace use of input.value with input.varible for validating/sizing inputs
…Link into fix/comp_and_mech/input_variable
Function_Base: - add input_shape_template attribute (as experiment for now)
- add: _input_shape_template, default_input_shape, input_shape, get_input_shape, default_external_input_shape, external_input_shape - _get_variable_from_input(): refactor to use above instead of variable or value
move from mechanism to inputport: _input_shape_template, default_input_shape, input_shape, get_input_shape
- get_variable_from_input(): - refactor to assign each item of input to corresponding input_port.variable and each input_port.value to result of executing its function with the variable
• function.py: input_shape_template -> changes_shape
…Link into fix/comp_and_mech/input_variable
add: test_get_input_format()
This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):
See CI logs for the full diff. |
This pull request introduces 3 alerts and fixes 1 when merging 5302106 into 8578bd1 - view on LGTM.com new alerts:
fixed alerts:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Major changes:
• Mechanism._get_variable_from_input()
- previously, simply assigned input as input_port.value, ignoring variable
- now assigns input as input_port.variable, calls input_port.execute, and assigns result to input_port.value
• Add changes_shape Parameter to Function and *_input_shape attributes to InputPort,
used to determine whether to base shape of inputs to an InputPort based on its variable
(if its input_port.function.changes_shape = True) or is value (as previously, and still useful/convenient in most cases,
such as LinearCombination which can accomodate many inputs but expects them all to be the same)
• Add Composition.get_input_format() that returns formatted inputs dict (with default input values)
appropriate for composition.run()
Specific changes:
• composition.py:
• mechanism.py:
external_input_shape, default_external_input_shape
_get_variable_from_input():
• function.py:
used to determine whether to base shape of input to an InputPort on its variable or OK to do so based on its value
• inputport.py:
• test_composition
• test_ddm_mechanism: