harthur / brain

Simple feed-forward neural network in JavaScript
MIT License
8k stars 857 forks source link

Segmented options #14

Open christopherdebeer opened 12 years ago

christopherdebeer commented 12 years ago

Hi, this post is more discussion than issue. It's related to what was said before on issue #13.

Currently brains, when created take options hiddenLayers & learningRate :

var net = new NeuralNetwork({
   hiddenLayers: [4],
   learningRate: 0.6
});

And when trained, take data and options errorThresh, iterations, log & logPeriod :

net.train(data, {
   errorThresh: 0.004,  
   iterations: 20000,
   log: true,
   logPeriod: 10
});

What I'm asking is this, given that one cannot iteratively train a these neural networks, why are there 2 points at which different options are provided to the neural network?

Does it not make sense to declare all options/setting in one place, ie on creation of the neural network?

Perhaps something like:

var net = new NeuralNetwork({
   hiddenLayers: [4],
   learningRate: 0.6,
   errorThresh: 0.004,  
   iterations: 20000,
   log: true,
   logPeriod: 10
});

net.train(data);

Chris

tlhunter commented 12 years ago

I would like to see brain one day be able to train multiple times instead of just once. If that were to happen, it would make sense to keep the settings as they currently are.

harthur commented 12 years ago

@christopherdebeer good point. I think more of them should actually move to the train() call, with maybe the hiddenLayers option sticking with the network initialization.

robertleeplummerjr commented 7 years ago

@tlhunter see: https://github.com/harthur/brain/pull/63