summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/reports/coverage.txt13
-rw-r--r--test/unit_tests/activationFunctions.test.js38
2 files changed, 27 insertions, 24 deletions
diff --git a/test/reports/coverage.txt b/test/reports/coverage.txt
index a2ed4c1..dc96a2d 100644
--- a/test/reports/coverage.txt
+++ b/test/reports/coverage.txt
@@ -1,6 +1,7 @@
---------------------|---------|----------|---------|---------|-------------------
-File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------------|---------|----------|---------|---------|-------------------
-All files | 83.78 | 100 | 70 | 86.11 |
- binaryConverter.js | 83.78 | 100 | 70 | 86.11 | 30-33,45
---------------------|---------|----------|---------|---------|-------------------
+------------------------|---------|----------|---------|---------|-------------------
+File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
+------------------------|---------|----------|---------|---------|-------------------
+All files | 90.32 | 100 | 84.21 | 91.66 |
+ activationFunctions.js | 100 | 100 | 100 | 100 |
+ binaryConverter.js | 83.78 | 100 | 70 | 86.11 | 30-33,45
+------------------------|---------|----------|---------|---------|-------------------
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);