From 52d9cb03004b00c0424d59a3b0ae897f827735be Mon Sep 17 00:00:00 2001 From: Christian Hodgden Date: Fri, 9 Feb 2024 14:40:06 -0600 Subject: Update activationFunctions.test.js Added test constructor --- test/unit_tests/activationFunctions.test.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'test') 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); -- cgit v1.2.3