diff options
author | sanine <sanine.not@pm.me> | 2023-06-17 12:55:58 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-06-17 12:55:58 -0500 |
commit | 9f233aa540f01848fea62f6f5031142c6e96621a (patch) | |
tree | 966abf8f138d0363f5b1f6007a5ab748d47d4faa /src/mind/topology.test.js | |
parent | c079d06fdeeaa5e7a7b007e5bbc35a2d19bbc316 (diff) |
fix the order of arbitrary neuron test
Diffstat (limited to 'src/mind/topology.test.js')
-rw-r--r-- | src/mind/topology.test.js | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/mind/topology.test.js b/src/mind/topology.test.js index b272040..9776132 100644 --- a/src/mind/topology.test.js +++ b/src/mind/topology.test.js @@ -175,17 +175,20 @@ test('arbitrary hidden neurons', () => { .connect(1, 2, -1) .connect(2, 3, 2) - expect(n.compute([1], [0, 0])).toEqual([ - [ Math.tanh ( - 2*Math.tanh( - -1*Math.tanh( 1 ) - ) - ) ], - [ - Math.tanh( -Math.tanh(1) ), - Math.tanh(1), - ], - ]); + const [output, state] = n.compute([1], [0, 0]); + + expect(output).toEqual([ + Math.tanh( + 2*Math.tanh( + -1*Math.tanh(1) + ) + ) + ]); + + expect(state).toEqual([ + Math.tanh(1), + Math.tanh( -Math.tanh(1) ), + ]); }); |