I am looking to incrementally train a neural net using Brain.js, but can't find a solution using the current version. There is a similar answer to this same problem but it uses a deprecated function parameter keepNetworkIntact
. How is this done?
Asked
Active
Viewed 1,107 times
1 Answers
4
You simply need to import the json into the neural network, and continue training:
const net = new brain.NeuralNetwork();
net.fromJSON(json);
net.train(trainingData, trainingOptions);
The feature was deprecated because we only want to keep the options we absolutely need to keep the api as simple as possible and based off importing json the net can determine what you intend to do next.

Robert Plummer
- 634
- 1
- 5
- 13
-
It still doesn't work for LSTM nets, after saving to file and reloading it keeps throwing `Error: Network error rate is unexpected NaN, check network configurations and try again. Most probably input format is not correct or training data is not enough.` "https://github.com/BrainJS/brain.js/issues/82" – Kyle May 31 '22 at 13:24