Brain.js: How to determine the correct number of inner layers for my task?

Created on 24 Jul 2018  路  5Comments  路  Source: BrainJS/brain.js

Hello.
I use this library for prediction.

I have event. It consists of 2 parts. It happens 0 or 1. It turns out [0,0],[0,1],[1,0],[1,1].
I use the last 50 such events and divide them into parts of 3 pieces.
Therefore, for example:
Input [[0,0],[0,0],[0,0]] , output [0,0].

Suppose I have information about already past events that look like this:
1,1,0,1,0,0,1,0,1,1,1,0,0,0.
Input [1,1,0,1,0,0] , output [1,0]
Input [0,1,0,0,1,0] , output [1,1]
Input [0,0,1,0,1,1] , output [1,0]
Input [1,0,1,1,1,0] , output [0,0]
Input [1,1,1,0,0,0] , output [?? , ??] (Here I get my prediction)

Next, I use advanced settings, such as:
_iterations_, _errorThresh_, _hiddenLayers_.

And there I have a problem.
For _hiddenLayers_ I use [15] and launch programm 5 times and find the average.
I think the answers are different, because I have the length of the neural network, but there is no width.

Do you think there is an ideal number of inner layers for my task or is it easier for me to choose it myself? Or the right amount of inner layers is [15,6] or [6,16] ???

help wanted

Most helpful comment

All 5 comments

Which classes are you using? Do you have a working example, perhaps on https://jsfiddle.net/?

I can send my code here or there. It is need ?
I dont understand how it can help.

Sure, share your code.

This is my code https://jsfiddle.net/scq9ur8k/
But there is not enough data. Do they also send?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robertleeplummerjr picture robertleeplummerjr  路  6Comments

lucaspojo picture lucaspojo  路  5Comments

omer54463 picture omer54463  路  6Comments

grigori-gru picture grigori-gru  路  4Comments

panzad3 picture panzad3  路  5Comments