필터 지우기
필터 지우기

How to monitor Deep learning training

조회 수: 2 (최근 30일)
Mustafa Yildiz
Mustafa Yildiz 2020년 4월 13일
댓글: Mohammad Sami 2020년 4월 13일
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