Can I resume training a neural network with a different data set?

9 views (last 30 days)
Table=AM03_a02b;
Matrix=Table{:,:};
Input=Matrix(1:end,1:7);
Output=Matrix(1:end,8:15)';
ANN=newff(Input,Output,[100 100 100 100 100 100]);
ANN.trainParam.max_fail=1000;
ANN.trainParam.epochs=10000;
ANN.trainFcn = 'trainbr';
ANN=train(ANN,Input,Output);
view(ANN)
I have a table that is 2.3 million row by 15 columns where the first 7 columns are the inputs and the last 8 columns are the outputs. My goal is to train a neural network such that I can give it any combination of the 7 inputs and it will output the best estimate of the 8 output values.
The thing is sometimes, when a combination of input values that is not expliclity defined in the training data (table) is given to the neural network, the simulation outputs a very poor estimate with high amount of errors. So my plan to avoid this was by doing the following:
After the data is done training on the gigantic table I have, I will want to build 10000 random cases of inputs (a random matrix that is 10000 by 7). Then I will use the neural network and check the average error on each case (error between the neural network output and the actual numbers), if the error is higher than 5%, I will retrain the network on the new 10000 cases.
The problem, I dont want to re-train the network on all the cases (2.3 million + 10000) again, I just want to use my already trained network and train it on the 10000 only. Is that possible? Do you guys have any additional suggestions?

Accepted Answer

Image Analyst
Image Analyst on 11 Jun 2023
Not exactly sure, but when you train you can specify a "Checkpoint" that keeps track of where you are in case something goes wrong during the training and the training aborts. Then there is someway to start up again using that Checkpoint to pick up where you left off. You might look into Checkpoint and see if there is a way you can use that checkpoint (which has info from your first test set) but then use new images in your subsequent training. Sorry, I have not done that so I don't have any demo code to offer you. Good luck.
Otherwise look into "transfer learning" where you can start off with an existing network (to start off with existing weights that are closer than just random weights) and adjust the weights as it trains with new images. There should be MATLAB documentation on transfer learning.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!