-
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
Prediction #204
Comments
Would you please elaborate your data sample, separated as inputs and outputs expected? |
@lmktommy - did you look at the LSTM architecture in the docs ...? That's the first thing that comes to mind when I read this. |
Also, I think this might work for you: #192 |
Sorry I've been so busy, yes this can be done with the TimeStep neural network. I'll see if I can get an example up before the end of the day. |
Working: https://jsfiddle.net/qvvdrvct/ |
const net = new brain.recurrent.LSTMTimeStep({
inputSize: 1,
hiddenLayers: [20, 5, 1],
outputSize: 1
});
const trainingData = [
[4,7,9],
[6,9,10],
[10,8,7]
];
const results = net.train(trainingData, { log: true });
// NOTE: Actual results
console.log(results); // {error: 0.0042235056559244795, iterations: 3586}
console.log(net.run([4,7])); // 8.998400688171387
console.log(net.run([6,9])); // 9.994184494018555
console.log(net.run([10,8])); // 6.999631404876709 |
Thank you for your explanation. I will try it soon.
On Tue, 15 May 2018 at 20:59, Robert Plummer ***@***.***> wrote:
const net = new brain.recurrent.LSTMTimeStep({
inputSize: 1,
hiddenLayers: [20, 5, 1],
outputSize: 1
});
const trainingData = [
[4,7,9],
[6,9,10],
[10,8,7]
];
const results = net.train(trainingData, { log: true });
// NOTE: Actual resultsconsole.log(results); // {error: 0.0042235056559244795, iterations: 3586}
console.log(net.run([4,7])); // 8.998400688171387console.log(net.run([6,9])); // 9.994184494018555console.log(net.run([10,8])); // 6.999631404876709
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#204 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHlkG-rpK1zzKqnelX0MNpX0dR4vKg3iks5tytE5gaJpZM4TtjaM>
.
--
Regards, Tommy Liu Sent from iPhone
|
robertleeplummerjr - Thank you for your reply. I would ask one more question that does the library return the prediction result? For example: I use dice as example - Set 1 [2,4,5], Set 2 [1,4,6], Set 3 [2,3,5]. Ask brain to predict Set 4. Thank you |
With that limited amount of data, it might but you'll likely get overfitting. However, if you had hundreds or thousands of dice, then it'd have little issue picking them out. |
I want to point out too, the above api is really a preview of things to come for v2, things will get a whole lot smarter and more interesting when it is released. |
Closing because we have a solution. |
Now supported with TimeStep neural networks via the Ty guys! |
Is it possible to use brainjs to predict the result?
Data:
4,7,9
6,9,10
10,8,7
Return predict result.
Like: https://jsfiddle.net/9t2787k5/4/
The text was updated successfully, but these errors were encountered: