summaryrefslogtreecommitdiff
path: root/test/unit_tests
diff options
context:
space:
mode:
authorChristian Hodgden <chrhodgden@gmail.com>2024-02-09 14:49:12 +0000
committerChristian Hodgden <chrhodgden@gmail.com>2024-02-09 14:49:12 +0000
commitd8e17c036eecadb17c6521fac23a5d956b8fd415 (patch)
tree1277e4753a78e7f96f2840e50ae3b91cd4068a52 /test/unit_tests
parent60e9f9e8a7df69aa94de0e9752a3faf3c0c62253 (diff)
added module imports and describe() method to activationFunction testing
Diffstat (limited to 'test/unit_tests')
-rw-r--r--test/unit_tests/activationFunctions.test.js38
1 files changed, 20 insertions, 18 deletions
diff --git a/test/unit_tests/activationFunctions.test.js b/test/unit_tests/activationFunctions.test.js
index b7fd570..ed39405 100644
--- a/test/unit_tests/activationFunctions.test.js
+++ b/test/unit_tests/activationFunctions.test.js
@@ -1,23 +1,25 @@
-console.log('Hello from activationFunctions.test.js');
+const activationFunctionList = require('../../src/activationFunctions');
+const math = require('mathjs');
-console.log(activationFunctionList);
+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 result;
+ let testVector = [-2, -1, 0, 1, 2];
+ testVector = math.matrix(testVector);
+ let testMatrix = math.matrix([testVector, testVector]);
+
+ result = activationFunctionList['sigmoid'].gx(testVector);
+ result = activationFunctionList['sigmoid'].dg_dx(testVector);
+
+ result = activationFunctionList['relu'].gx(testMatrix);
+ result = activationFunctionList['relu'].dg_dx(testMatrix);
+
+ result = activationFunctionList['identity'].gx(testMatrix);
+ result = activationFunctionList['identity'].dg_dx(testMatrix);
+
+ test.todo('Activation Function Tests');
+
+});
-result = activationFunctionList['sigmoid'].gx(testVector);
-console.log(result);
-result = activationFunctionList['sigmoid'].dg_dx(testVector);
-console.log(result);
-result = activationFunctionList['relu'].gx(testMatrix);
-console.log(result);
-result = activationFunctionList['relu'].dg_dx(testMatrix);
-console.log(result);
-result = activationFunctionList['identity'].gx(testMatrix);
-console.log(result);
-result = activationFunctionList['identity'].dg_dx(testMatrix);
-console.log(result);