-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/backprop fct with multi args #2766
Conversation
• combinationfunctions.py LinearCombination.derivative: return Jacobian for first item in variable[0] relative to others • composition.py _create_non_terminal_backprop_learning_components(): modify to handle multiple args in output_source for learning_function and learning_mechanism
• combinationfunctions.py LinearCombination.derivative: return Jacobian for first item in variable[0] relative to others • composition.py _create_non_terminal_backprop_learning_components(): modify to handle multiple args in output_source for learning_function and learning_mechanism
• composition.py - _check_for_existing_projections(): augment to search over all input_ports and output_ports; NOTE: if a mechanism is specified as sender and/or receiver, then any existing Projection between the two (i.e., between any pair of input_port/output_ports) will be returned as existing; to support multiple projections (between different pairs of Ports), must specify Ports explicitly
- fully refactored to use covariates • composition.py _create_non_terminal_backprop_learning_components(): refactored to use covariates RUNS
- make error_sources and covariates_sources Parameters
# Conflicts: # psyneulink/core/compositions/composition.py
…Link into feat/backprop_fct_with_multi_args # Conflicts: # psyneulink/core/components/functions/nonstateful/combinationfunctions.py # psyneulink/core/components/functions/nonstateful/learningfunctions.py # psyneulink/core/compositions/composition.py
This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):
See CI logs for the full diff. |
This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):
See CI logs for the full diff. |
from psyneulink.core.components.ports.parameterport import ParameterPort | ||
from psyneulink.core.components.ports.modulatorysignals.learningsignal import LearningSignal |
Check notice
Code scanning / CodeQL
Cyclic import
def _get_acts_in_and_out(input_source, output_soruce): | ||
def _get_covariate_info(output_source, learned_projection)->(list[InputPort]): | ||
"""Get the templates and Projections from potential covariates""" | ||
def _non_additive_comb_fct(function, allow)->Union[bool, None]: |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns
loggable=False, | ||
read_only=True, | ||
structural=True) | ||
def _parse_covariates_sources(self, covariates_sources): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns
if covariates_sources: | ||
return convert_to_list(covariates_sources) | ||
|
||
def _parse_error_sources(self, error_sources): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns
# if error_sources: | ||
# self.parameters.input_ports._set(self.input_ports[:2] + [ERROR_SIGNAL] * len(error_sources),context) |
Check notice
Code scanning / CodeQL
Commented-out code
@@ -541,8 +574,9 @@ | |||
from psyneulink.core.components.mechanisms.mechanism import Mechanism_Base, MechanismError | |||
from psyneulink.core.components.mechanisms.modulatory.modulatorymechanism import ModulatoryMechanism_Base | |||
from psyneulink.core.components.mechanisms.processing.objectivemechanism import ObjectiveMechanism | |||
from psyneulink.core.components.ports.modulatorysignals.learningsignal import LearningSignal | |||
from psyneulink.core.components.ports.inputport import InputPort |
Check notice
Code scanning / CodeQL
Cyclic import
@@ -698,7 +698,7 @@ | |||
VARIABLE: self.variable[i], | |||
PROJECTIONS: field} | |||
for i, field in enumerate(self.fields)] | |||
return super()._instantiate_input_ports(input_ports=input_ports, context=context) | |||
return super(LearningMechanism,self)._instantiate_input_ports(input_ports=input_ports, context=context) |
Check failure
Code scanning / CodeQL
First argument to super() is not enclosing class
This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):
See CI logs for the full diff. |
This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):
See CI logs for the full diff. |
This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):
See CI logs for the full diff. |
• composition.py, learningmechanism.py and learningfunctions.py
• combinationfunctions.py