brain.js icon indicating copy to clipboard operation
brain.js copied to clipboard

.run() not working

Open MuhtisimDedektif opened this issue 2 years ago • 5 comments

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);

MuhtisimDedektif avatar Dec 04 '22 14:12 MuhtisimDedektif

Do you get any error in the console when trying to run your code?

purplnay avatar Dec 27 '22 09:12 purplnay

Same here.. no any error.. the code is not running...

roysG avatar Apr 08 '23 04:04 roysG

Copy and Paste the example

roysG avatar Apr 08 '23 04:04 roysG

@MuhtisimDedektif, Did you fix it?

roysG avatar Apr 08 '23 04:04 roysG

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,
});

purplnay avatar Apr 08 '23 04:04 purplnay