Effacer les filtres
Effacer les filtres

How to monitor Deep learning training

2 vues (au cours des 30 derniers jours)
Mustafa Yildiz
Mustafa Yildiz le 13 Avr 2020
Commenté : Mohammad Sami le 13 Avr 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 commentaires
Mohammad Sami
Mohammad Sami le 13 Avr 2020
Matlab also provides a free online course on deep learning. You can check it out here

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Sequence and Numeric Feature Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by