summaryrefslogtreecommitdiff
path: root/test/unit_tests/activationFunctions.test.js
blob: b7fd570a9a556a6eb9791f47a943e77e32b29a6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
console.log('Hello from activationFunctions.test.js');

console.log(activationFunctionList);

let result;
let testVector = [-2, -1, 0, 1, 2];
testVector = math.matrix(testVector);
let testMatrix = math.matrix([testVector, testVector]);

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);