Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
jdcpni committed Nov 22, 2024
1 parent ac76df6 commit d3507b1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion psyneulink/library/compositions/emcomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -2736,7 +2736,7 @@ def _identify_target_nodes(self, context)->list:
def infer_backpropagation_learning_pathways(self, execution_mode, context=None):
if self.concatenate_queries:
raise EMCompositionError(f"EMComposition does not support learning with 'concatenate_queries'=True.")
super().infer_backpropagation_learning_pathways(execution_mode, context=context)
return super().infer_backpropagation_learning_pathways(execution_mode, context=context)

def do_gradient_optimization(self, retain_in_pnl_options, context, optimization_num=None):
# 7/10/24 - MAKE THIS CONTEXT DEPENDENT: CALL super() IF BEING EXECUTED ON ITS OWN?
Expand Down
4 changes: 0 additions & 4 deletions tests/composition/test_emcomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,8 @@ def test_field_args_and_map_assignments(self,

# Validate targets for target_fields
np.testing.assert_allclose(em.target_fields, [True, False, False, True, True])
# learning_components = em.infer_backpropagation_learning_pathways(pnl.ExecutionMode.Python)
learning_components = em.infer_backpropagation_learning_pathways(pnl.ExecutionMode.PyTorch)
# FIX: FOLLOWING LINE SHOULDN'T BE NEEDED
learning_components = [node for node in em.nodes if 'TARGET' in node.name]
assert len(learning_components) == 3

assert 'TARGET for KEY A [RETRIEVED]' in learning_components[0].name
assert 'TARGET for KEY VALUE [RETRIEVED]' in learning_components[1].name
assert 'TARGET for VALUE LEARN [RETRIEVED]' in learning_components[2].name
Expand Down

0 comments on commit d3507b1

Please sign in to comment.