brain.js
brain.js copied to clipboard
.run() not working
net.run() not working. My code:
const brain = require('brain.js'); const net = new brain.recurrent.LSTM(); net.train([ 'minecraft is a game' ]); var a = net.run('minecraft') console.log(a);
Do you get any error in the console when trying to run your code?
Same here.. no any error.. the code is not running...
Copy and Paste the example
@MuhtisimDedektif, Did you fix it?
Does net.run()
not work or does it stay stuck on the training?
The training can take some time and if you don't log its progress it can be hard to tell if it's still iterating over the training data or if it's done training.
You can try this in case it logs anything into the console:
net.run(['minecraft is a game'], {
log: true,
});
If it takes too long to train, you can lower the number of iterations needed to complete the training:
net.run(['minecraft is a game'], {
log: true,
iterations: 500,
});