Effacer les filtres
Effacer les filtres

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

4 vues (au cours des 30 derniers jours)
AK le 30 Mar 2021
Commenté : AK le 15 Avr 2021
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
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)

Réponse acceptée

Divya Gaddipati
Divya Gaddipati le 9 Avr 2021
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 commentaire
AK le 15 Avr 2021
How do i output the activation information once i have it? Like if i want to print it ? Thanks!

Connectez-vous pour commenter.

Plus de réponses (0)


En savoir plus sur Deep Learning Toolbox 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