How do you get the Classification Layer Probabilities for pretrained CNNs ?

조회 수: 10 (최근 30일)
AK
AK 2021년 3월 30일
댓글: AK 2021년 4월 15일
Hello,
I have code that runs through a file of images and classifies each, using the pretrained Squeezenet network. I want to get the results of the classification layer and save all the probabilities and the end classification choice. How do I do this?
Thank you!
for k = 1:numFiles
try
full_path=fullfile(imgs(k).folder, imgs(k).name);
mydata{k} = imread(full_path);
i = imresize(mydata{k},[227,227]);
a = classify(net, i)
imshow(i); title(char(a))
catch ME
fprintf("The imread call threw the following error:\n%s\n", ME.message)
fprintf("The error identifier for this error is:\n%s\n", ME.identifier)
end
end

채택된 답변

Divya Gaddipati
Divya Gaddipati 2021년 4월 9일
You can use activations to get the output at a certain layer
out = activations(net,X,'layerName');
For more information, refer to the link below:
  댓글 수: 1
AK
AK 2021년 4월 15일
How do i output the activation information once i have it? Like if i want to print it ? Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by