bradtraversy / brainjs_examples

Some examples of simple machine learning using Brain.js
122 stars 60 forks source link

Weird unexpected behavior #3

Open jochemstoel opened 5 years ago

jochemstoel commented 5 years ago

When I run your example _02hardware-software.js I sometimes (not always) get weird unpredictable characters from the training data input prepended to the output. I did not modify the script or the training data.

When I run the file I get stuff stuff like: Category: plyhardware Category: ore memoryhardware Category: soma pwae minghardware Category: nit test failedsoftware

I don't understand this. Do you?

Node 11.5.0 Windows 10

birksy89 commented 5 years ago

Very interesting - I got the same thing on the 3rd run of _02hardware-software.js

Category: ofted a lystop-inputstart-outputhardware

Node 11.2.0 Windows 10

Praneet460 commented 5 years ago

I think the reason behind is that somehow the LSTM model is also training itself with the text in the category section. To solve this issue we need to represent our categories with the help of the dummy variables like replace software with [0] and replace hardware with [1] After replacing and re-training your model you will find it working fine.