I want to train a network and save the weights. Then use a new data set and resume training with the weights from the previous data set.
21 ビュー (過去 30 日間)
Sonam Gupta 2018 年 3 月 28 日
You can continue the training from weights obtained by previous data set by extracting the layers from the network's "Layers" property, and then passing it to "trainNetwork", as follows:
% Train a network
net = trainNetwork(XTrain, YTrain, layers, options);
% Extract layers from the trained network
newLayers = net.Layers;
% Retrain the network, but start from where we left off
newNet = trainNetwork(XTrain, YTrain, newLayers, options);
'trainNetwork' will always use the weights that are stored in the layers which you pass in for training.