Running a value against the network gives some strange outputs
In brain.recurrent.LSTM on my Surface, latest version of Windows, x64
const brain = require('brain.js');
const net = new brain.recurrent.LSTM();
const trainingData = [
{
input: 'Hello',
output: 'Hi'
},
{
input: 'Hi',
output: 'Hello'
},
{
input: 'Greetings!',
output: 'Hello'
},
{
input: 'Hello',
output: 'Greetings!'
},
{
input: 'Hi, How is it going?',
output: 'Good'
},
{
input: 'Hi, How is it going?',
output: 'Fine'
},
{
input: 'Hi, How is it going?',
output: 'Okay'
},
{
input: 'Hi, How is it going?',
output: 'Great'
},
{
input: 'Hi, How is it going?',
output: 'Could be better.'
},
{
input: 'Hi, How is it going?',
output: 'Not so great.'
}
];
net.train(trainingData, {
log: true,
logPeriod: 100,
learningRate: 0.3,
iterations: 2000
});
const output = net.run('hi');
console.log(output);
5
I should have gotten this response (or something simillar):
"Hello"
Instead of "Hello", I got NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
Are you actually able to train with this format?
[
{
"question": "Hello",
"answer": "Hi"
},...
Are you actually able to train with this format?
[ { "question": "Hello", "answer": "Hi" },...
Sorry, I added my question wrongly. I just updated it to include the most accurate information possible.
馃憤 Looking into this now, fyi.
The only fix I found for it is to create a set of key-value pairs like this:
{
input: 'Hi, How is it going?',
output: '0'
}
Where 0 corresponds to "Great" after getting the output of the network.
Any update on this? Thanks
I have create a working demo here: https://runkit.com/mubaidr/brain-lstm
Training does complete and network returns output too. You need to provide better training set though. Also for more information on this topic, please check:
https://github.com/BrainJS/brain.js/issues/535
https://github.com/BrainJS/brain.js/issues/235
https://github.com/BrainJS/brain.js/issues/217
@robertleeplummerjr please
I think the only way to fix this is to not use this method of creating chatbots. There are plenty of other ways to create deep learning chatbots like Tensorflow.js with the Seq2seq model. Will close this issue now.
Most helpful comment
馃憤 Looking into this now, fyi.