问题
How can I train new information(Only the new information,not everything again, since it would cost too much performance) to my neural network made with brain.js after the first training?
回答1:
Its a little rough but you could achieve that using this structure:
if we join 2 training data sets, old with new one and then retrain with keepNetworkIntact: true
then our NN will be retrained much much faster than as if we retrain it from scratch.
let net = new brain.NeuralNetwork();
// pre-training
net.train([
{input: [0, 0], output: [0]},
{input: [1, 1], output: [0]}
]);
// resume training with new data set
net.train([
{input: [0, 0], output: [0]}, // old training data set
{input: [1, 1], output: [0]}
].concat([
{input: [0, 1], output: [1]}, // joining new training data set
{input: [1, 0], output: [1]},
],
{keepNetworkIntact:true}
);
i know Brain.JS was about to introduce a feature called resumeableTraining
which i am not sure if implemented. Its worth checking docs though.
Happy Braining!!!
来源:https://stackoverflow.com/questions/51295463/training-brain-js-multiple-times