(data, op, done)
| 32 | } |
| 33 | |
| 34 | function 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 | |
| 51 | describe('bitwise functions sync training', () => { |
| 52 | it('NOT function', () => { |
nothing calls this directly
no test coverage detected