blob: 4b68deb36609aa328ad2c4388fefa400fa3cf4a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
const activationFunctionList = require('../../src/activationFunctions');
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]);
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');
});
|