
This is mostly a question, this might be the expected outcome for this code.
When i train your LSTM "happy/sad" example and run it with some strings it has not seen before i get some unexpected outcomes.
console.log(net.run("I feel great about the world!"))
console.log(net.run("The world is a terrible place!"))
console.log(net.run("I am the greatest!"))
console.log(net.run("I am terrible"))
console.log(net.run("I am the sadest!"))
console.log(net.run("I am the happiest"))
yields
happy
sad
happy
the world!happy
happy
e!sad
Computer
MacBook Pro
Intel Core i7 2,6 GHz
16 GB
Env
node v10.20.1
import brain from "brain.js"
const net = new brain.recurrent.LSTM()
net.train(
[
{ input: "I feel great about the world!", output: "happy" },
{ input: "The world is a terrible place!", output: "sad" }
],
{ log: true, iterations: 10000 }
)
console.log(net.run("I feel great about the world!"))
console.log(net.run("The world is a terrible place!"))
console.log(net.run("I am the greatest!"))
console.log(net.run("I am terrible"))
console.log(net.run("I am the sadest!"))
console.log(net.run("I am the happiest"))
instead of getting this result
happy
sad
happy
the world!happy
happy
e!sad
i would like to get this
happy
sad
happy
happy
happy
sad
node v10.20.1
N/A
"brain.js": "^2.0.0-beta.1"
5 if this is not expected
1 if i have misunderstood everything.
Really cool library i like it alot so far!
Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.75. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
Try adding more data.
Lack of data is one of the main reasons
NN's took so long to start being used.
Some structure to the the net it self is needed try:
const net = new brain.recurrent.LSTM({
inputSize: 1,
hiddenLayers: [5,5,5],
outputSize: 1
})
Play with the hiddenLayers see what comes up.
P.S the output is very expected and even wanted, this the net trying to deal
with something it never saw before.
Most helpful comment
Issue-Label Bot is automatically applying the label
questionto this issue, with a confidence of 0.75. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!Links: app homepage, dashboard and code for this bot.