Filter löschen
Filter löschen

How to monitor Deep learning training

2 Ansichten (letzte 30 Tage)
Mustafa Yildiz
Mustafa Yildiz am 13 Apr. 2020
Kommentiert: Mohammad Sami am 13 Apr. 2020
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 Kommentare
Mohammad Sami
Mohammad Sami am 13 Apr. 2020
Matlab also provides a free online course on deep learning. You can check it out here

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by