Skip to content

Commit

Permalink
tests: test_call_after_construction_with_learning_pathway: fix missin…
Browse files Browse the repository at this point in the history
…g assert (#2647)

np.allclose call was not asserted since this test was added. The
results for this call changed in
0946af0 (#1639) due to a change in
default for argument loss_spec (formerly loss_function) from None to
MSE in add_linear_learning_pathway and
_create_backpropagation_learning_pathway.

As of this commit, changing these defaults back to None produces the
numeric results that were present when this test was created.

The allclose call also misinterpreted the return value for
Composition.run as producing multiple trial outputs that are instead in
Composition.results
  • Loading branch information
kmantel authored May 3, 2023
1 parent 28ec909 commit 9eb9f3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/composition/test_composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_call_after_construction_with_learning_pathway(self):
# Run with learning
target = c.pathways['LEARNING_PATHWAY'].target
result = c(inputs={A:[[1],[100]],B:[[2],[1]],target:[[3],[300]]})
np.allclose(result, [[[1.], [0.73105858]], [[100.], [0.62507661]]])
np.testing.assert_allclose(c.results[-2:], [[[1.], [0.73105858]], [[100.], [0.62768661]]])


class TestAddMechanism:
Expand Down

0 comments on commit 9eb9f3a

Please sign in to comment.