MCPcopy
hub / github.com/BrainJS/brain.js / trainWithLogAsync

Function trainWithLogAsync

test/base/log.js:22–34  ·  view source on GitHub ↗
(log, expected, done)

Source from the content-addressed store, hash-verified

20 }
21
22 function trainWithLogAsync(log, expected, done) {
23 let net = new brain.NeuralNetwork();
24 net
25 .trainAsync(
26 [ {input: [0], output: [0]} ],
27 { log: log, logPeriod: 1, iterations: 1 }
28 )
29 .then(res => {
30 assert.equal(logCalled, expected);
31 done();
32 })
33 .catch(err => { assert.ok(false, err.toString()) });
34 }
35
36 it('should call log method', () => { trainWithLog(logFunction, true); });
37 it('should not call log method', () => { trainWithLog(false, false); });

Callers

nothing calls this directly

Calls 3

trainAsyncMethod · 0.95
toStringMethod · 0.80
doneFunction · 0.50

Tested by

no test coverage detected