How do you get the Classification Layer Probabilities for pretrained CNNs ?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
AK
el 30 de Mzo. de 2021
Comentada: AK
el 15 de Abr. de 2021
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
0 comentarios
Respuesta aceptada
Divya Gaddipati
el 9 de Abr. de 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:
Más respuestas (0)
Ver también
Categorías
Más información sobre Deep Learning Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!