So guys, I'm running some tests using brain.js, I got this code from different examples, but when I try to run it, nothing happens, there is no response. I already tried to wait few time to see if it would come up with a response, but seems to be doing nothing..
import brain from 'brain.js'
const net = new brain.recurrent.LSTM();
net.train([
{ input: "my unit-tests failed.", output: "software" },
{ input: "tried the program, but it was buggy.", output: "software" },
{ input: "i need a new power supply.", output: "hardware" },
{ input: "the drive has a 2TB capacity.", output: "hardware" },
{ input: "unit-tests", output: "software" },
{ input: "program", output: "software" },
{ input: "power supply", output: "hardware" },
{ input: "drive", output: "hardware" },
]);
console.log("output = " + net.run("drive"));
I don't think this is a problem related to the code because as I said, I saw like 3 different examples running almost the same code, just changing the data, and it is not working for me. What can be the problem?
Try to add config to your training.
The following code works for me just fine. I saw that the error value just get stuck round about 0.01 and it never reaches the default "errorThresh" of 0.005. Which leads to many many iterations in training.