-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
benchmarks, and issue with RNN #108
Comments
First off, ty ty ty for the help! After you train the nets, have your ran them against a valid output and seen what the result is? |
Yeah I believe so. The last 4 lines of each test are running the respective network. They’re basically the same as the examples from the current readme. |
Ah yes, an oversight on my part. I was playing Mario with my kids, and took a moment to answer. Shame on me :). TL;DR TS;DR The standard feedforward neural net ( It seems in mathematics, and in the popular neural networks, the smaller you write something, the more successful you are... While at the same time, I feel very strongly that is rudely curt. Why? In a way the one practicing this curt lingo is in a sense "encrypting" the various ideologies behind their work. They take perfectly valid ideas and reduce the terminology to that of something you'd have to go to Harvard to understand. Terms like: Sorry about the "rant", but what I'm coming to is that the error output is different. The recurrent neural net uses "Momentum Root Mean Squared Error Propagation" found here, generally referred to as "momentum with rmsprop" of each network output added together for each iteration through the library (all inputs are tested, their error calculated and summed) and then we divide the sum by the count of training samples we were given. Brain.js' The difference between the values is that they don't represent the same measurement, Momentum Root Mean Squared Error Propagation is generally higher, while Mean Squared Error is generally far lower. Many of these terms I would not have known going into this project, and it has been both a headache and one of the greatest adventures I've ever had as a programmer. Much like climbing a mountain, learning the guitar, or running a 40k, It has been very fulfilling.
This line alone makes very happy, and I look very much forward to your first PR, and will do what I can to help. Call to action to anyone reading this: Node and Javascript is one of the largest development communities, it is just about the numbers. Build a bridge, and they will cross. It would have been a whole lot easier to just copy and paste and translate without understanding the actual underlying code (which |
Thanks so much for that! We should use your post as a start to the wiki. Makes sense about the error value. I will continue to experiment with LSTM's and RNN's in hopes that we can come up with some more useful documentation. The goals of this project, and the sentiment of your post really resonate with me so I'm excited to help. Neural networks ARE simple but it seems nobody can explain them to someone who's never built one. edit: I had thought of a few questions while reading your post, and then forgot to ask them. I think the answers to the first couple will help me answer the rest I have in my head. Do the RNN and LSTM networks use the same default construction options as the NeuralNetwork detailed here? Also, do they use the same defaults when training? If the answer to both of those is yes, do you think they're sensible, or should they be changed? For example, in your post you said that the higher error output of the example LSTM and RNN is normal. Should the default |
Close, they have their own: Line 701 in ef3811e
and it shared for the other recurrent classes: brain.js/src/recurrent/lstm.js Line 5 in d9dc977
Line 5 in d9dc977
Likely after v2 is released (v1 in a few days, probably any time) the import { Recurrent, layer } from 'brain.js';
const { input, lstm, output } = layer;
const net = new Recurrent({
inputLayer: () => input,
hiddenLayers: [(input, recurrentInput) => lstm(input, recurrentInput)],
outputLayer: (input) => output(input)
});
net.train();
net.run(); I might write a little of it tonight... but I digress. Note: I say "planned" |
I think I follow! Thanks again! More on construction... Let's say I want a LTSM.. |
Come to think of it, I actually already composed the net layers. I call this "layer composition", and I really feel it is like the "ah! that is how they work!", moment when you see them. At least they are the most important part of the networks:
This is one of the main differences I've seen with brain.js and other libs. layers, or layers composed of layers, composed of layers, composed of layers, becomes very easy. So you could define a stochastic spiking long short term memory weather forecasting snow shoveling neural network with ease. I'd like to see "them" name that net. |
Nailed it. Too, there is an input and output converter, which convert a single word, to a neuron index for inputs and outputs. So you can use plan english to train the net, and the net will do the hard work for you. I'll take a look and see if I can get it running. |
Running: #109 (comment) Have fun! |
Closing. I think we’re good here. Looking forward to seeing v2! |
I'm trying to write some better examples for RNN and LSTM, but ran into some snags and decided to start very simply. In short, my LSTM networks were taking forever to train in my projects, so I went back to basics and created this benchmark:
The output is interesting (2015 MacBook pro):
Any idea what I might be doing wrong, or could do to improve their accuracy? I realize not much can be done for performance (in node) atm and that is fine. I don't mind waiting for them to train if I can get reasonable error values out of them, and of course, be able to trust that I'm doing it right.
The text was updated successfully, but these errors were encountered: