Skip to content

Stream training errors #226

@rdominy

Description

@rdominy

What is wrong?

Attempting to use the stream training (net.createTrainStream followed by flooding the stream) throws errors as it attempts to access non-existent methods. I attempted to map the similarly named _methods (_formatData, _initialize, etc), but that led to more errors.

Where does it happen?

Running this under node.js (v 10.5.0, but doesn't appear to be version specific) on my Mac I get errors like this:

node_modules/brain.js/dist/train-stream.js:142
        var data = this.neuralNetwork.formatData(this.firstDatum);
                                      ^

TypeError: this.neuralNetwork.formatData is not a function

How do we replicate the issue?

Run the sample: examples/cli/stream-example.js

How important is this (1-5)?

4

Expected behavior (i.e. solution)

Sample should run without error.

Other Comments

If streaming can't be easily fixed, are there alternative ways of training in small batches? I'm trying to train with a very large data set that doesn't fit into memory all at once.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions