diff options
author | Christian Hodgden <chrhodgden@gmail.com> | 2024-02-09 14:40:06 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-09 14:40:06 -0600 |
commit | 52d9cb03004b00c0424d59a3b0ae897f827735be (patch) | |
tree | 16d7615b005608650efd918221786e58816ff06a /test | |
parent | 75778c23de167946b8f567379da78c965aea9d87 (diff) |
Update activationFunctions.test.js
Added test constructor
Diffstat (limited to 'test')
-rw-r--r-- | test/unit_tests/activationFunctions.test.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/unit_tests/activationFunctions.test.js b/test/unit_tests/activationFunctions.test.js index 4b68deb..2ed0cfe 100644 --- a/test/unit_tests/activationFunctions.test.js +++ b/test/unit_tests/activationFunctions.test.js @@ -4,10 +4,15 @@ const math = require('mathjs'); describe('Test Activation Function module', () => { let result; - let testVector = [-2, -1, 0, 1, 2]; - testVector = math.matrix(testVector); - let testMatrix = math.matrix([testVector, testVector]); + let testVector; + let testMatrix; + beforeEach(() => { + testVector = [-2, -1, 0, 1, 2]; + testVector = math.matrix(testVector); + testMatrix = math.matrix([testVector, testVector]); + }); + result = activationFunctionList['sigmoid'].gx(testVector); result = activationFunctionList['sigmoid'].dg_dx(testVector); |