How to monitor Deep learning training

2 次查看(过去 30 天)
Hello i wanna monitor the training when its happening , how should i change the code for that ?
outputFolder = fullfile('faceset');
rootFolder = fullfile(outputFolder,'faces');
categories = {'Ali','amanda','Betul','Clarisse','Elizabet','Erica','Firdevs','Furkan','Gabia','Gabriela','Irem','Justa','Kadir','Laura','Mehmet','Merve','Mustafa','Oguz','Ruta','Vika','Yigit'}; %choosing the categories which is gonna go to training
imds = imageDatastore(fullfile(rootFolder,categories),'LabelSource','foldernames');
tbl = countEachLabel(imds);
minSetCount = min(tbl{:,2});
imds = splitEachLabel(imds, minSetCount,'randomize');
countEachLabel(imds);
Ali = find(imds.Labels == 'Ali',1);
amanda = find(imds.Labels == 'amanda',1);
net = resnet101();
net.Layers(1);
net.Layers(end);
[trainingSet,testSet] = splitEachLabel(imds,0.3,'randomize');
imageSize = net.Layers(1).InputSize;
augmentedTrainingSet = augmentedImageDatastore(imageSize,...
trainingSet,'ColorPreprocessing','gray2rgb');
augmentedTestSet = augmentedImageDatastore(imageSize,...
testSet,'ColorPreprocessing','gray2rgb');
w1 = net.Layers(2).Weights;
w1 = mat2gray(w1);
featureLayer = 'fc1000';
trainingFeatures = activations(net,augmentedTrainingSet,...
featureLayer,'MiniBatchSize',32,'OutputAs','columns');
trainingLables = trainingSet.Labels;
classifier=fitcecoc(trainingFeatures,...
trainingLables,'Learner','Linear','Coding','onevsall','ObservationsIn','columns');
testFeature = activations(net,augmentedTestSet,...
featureLayer,'MiniBatchSize',32,'OutputAs','columns');
predictLabels = predict(classifier, testFeature,'ObservationsIn','columns');
testLables = testSet.Labels;
confMat = confusionmat(testLables , predictLabels);
confMat = bsxfun(@rdivide , confMat , sum(confMat,2));
mean(diag(confMat));
  3 个评论
Mohammad Sami
Mohammad Sami 2020-4-13
Matlab also provides a free online course on deep learning. You can check it out here

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by