[1422d3]: / functions / gradcam.m

Download this file

8 lines (5 with data), 257 Bytes

1
2
3
4
5
6
7
function [convMap,dScoresdMap] = gradcam(dlnet, dlImg, softmaxName, convLayerName, classfn)
[scores,convMap] = predict(dlnet, dlImg, 'Outputs', {softmaxName, convLayerName});
classScore = scores(classfn);
dScoresdMap = dlgradient(classScore,convMap);
end