MCPcopy Index your code
hub / github.com/BrainJS/brain.js / testBitwiseAsync

Function testBitwiseAsync

test/base/bitwise.js:34–49  ·  view source on GitHub ↗
(data, op, done)

Source from the content-addressed store, hash-verified

32}
33
34function testBitwiseAsync(data, op, done) {
35 let net = new brain.NeuralNetwork();
36 net
37 .trainAsync(data, { errorThresh: 0.003 })
38 .then(res => {
39 data.forEach(d => {
40 var actual = net.run(d.input)
41 var expected = d.output;
42 assert.ok(isAround(actual, expected), `failed to train "${op}" - expected: ${expected}, actual: ${actual}`);
43 });
44 done();
45 })
46 .catch(err => {
47 assert.ok(false, err.toString())
48 });
49}
50
51describe('bitwise functions sync training', () => {
52 it('NOT function', () => {

Callers

nothing calls this directly

Calls 5

trainAsyncMethod · 0.95
runMethod · 0.95
isAroundFunction · 0.85
toStringMethod · 0.80
doneFunction · 0.50

Tested by

no test coverage detected