brainjs / train-stream Goto Github PK
View Code? Open in Web Editor NEWA node train stream for brain.js
License: MIT License
A node train stream for brain.js
License: MIT License
I tried to configure a Recurrent network to use train-stream, but ran into the following error:
one-brain-1 | node:internal/event_target:1037
one-brain-1 | process.nextTick(() => { throw err; });
one-brain-1 | ^
one-brain-1 |
one-brain-1 | TypeError [Error]: neuralNetwork.updateTrainingOptions is not a function
one-brain-1 | at new TrainStream (/one/node_modules/train-stream/dist/index.js:41:23)
one-brain-1 | at MessagePort.<anonymous> (file:///one/src/encoder.js:57:29)
one-brain-1 | at [nodejs.internal.kHybridDispatch] (node:internal/event_target:762:20)
one-brain-1 | at exports.emitMessage (node:internal/per_context/messageport:23:28)
one-brain-1 | Emitted 'error' event on Worker instance at:
one-brain-1 | at [kOnErrorMessage] (node:internal/worker:326:10)
one-brain-1 | at [kOnMessage] (node:internal/worker:337:37)
one-brain-1 | at MessagePort.<anonymous> (node:internal/worker:232:57)
one-brain-1 | at [nodejs.internal.kHybridDispatch] (node:internal/event_target:762:20)
one-brain-1 | at exports.emitMessage (node:internal/per_context/messageport:23:28)
one-brain-1 |
one-brain-1 | Node.js v20.3.1
I was unsure if this was a known issue. The docs say nothing about supporting the Recurrent class, nor do I even think the class is ready, in vanilla Brain.js? I'm not sure, but I've struggled to make one of these networks work in any environment.
When I instantiate a GRU/LSTM network, I can use the .toJSON() method without issue. When I train with vanilla Brain.js, I can also export without issue.
When I train with train-stream, the network cannot be exported. There are two errors I keep running into.
This one happens while running in the main thread:
one-brain-1 | RangeError: Maximum call stack size exceeded
one-brain-1 | at GRU.toJSON (/one/node_modules/brain.js/dist/index.js:7632:11)
one-brain-1 | at JSON.stringify (<anonymous>)
one-brain-1 | at file:///one/src/encoder.js:79:46
And this one happens in a worker:
one-brain-1 | node:internal/event_target:1037
one-brain-1 | process.nextTick(() => { throw err; });
one-brain-1 | ^
one-brain-1 |
one-brain-1 | RangeError [Error]: Maximum call stack size exceeded
one-brain-1 | at GRU.toJSON (/one/node_modules/brain.js/dist/index.js:7632:11)
one-brain-1 | at JSON.stringify (<anonymous>)
one-brain-1 | at MessagePort.<anonymous> (file:///one/src/encoder.js:36:50)
one-brain-1 | at [nodejs.internal.kHybridDispatch] (node:internal/event_target:762:20)
one-brain-1 | at exports.emitMessage (node:internal/per_context/messageport:23:28)
one-brain-1 | Emitted 'error' event on Worker instance at:
one-brain-1 | at [kOnErrorMessage] (node:internal/worker:326:10)
one-brain-1 | at [kOnMessage] (node:internal/worker:337:37)
one-brain-1 | at MessagePort.<anonymous> (node:internal/worker:232:57)
one-brain-1 | at [nodejs.internal.kHybridDispatch] (node:internal/event_target:762:20)
one-brain-1 | at exports.emitMessage (node:internal/per_context/messageport:23:28)
one-brain-1 |
one-brain-1 | Node.js v20.3.1
Node 18 fails with the same error. I'm not sure how to proceed at this point.
On a different note, will this run in the browser? And if not, are there any plans to bring the functionality?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.