Class: dlhdl.Workflow
Package: dlhdl
Retrieve intermediate layer results for deployed deep learning network
activations(
returns intermediate layer activation data results for the image data in
imIn
,layername
)imIn
, and the name of the layer specified in
layername
. The result size depends on the output size of the layer. The
layer output size can be retrieved by using analyzeNetwork
.
activations(
returns
intermediate layer activation data results for the image data in imIn
,layername
, Name,Value
)imIn
,
and the name of the layer specified in layername
, with additional options
specified by one or more Name,Value
pair arguments. The result size
depends on the output size of the layer. The layer output size can be retrieved by using
analyzeNetwork
.
Retrieve the activation results of the LogoNet
maxpool_3
layer for a given input image.
Create a file in your current working directory called
getLogoNetwork.m
. Enter these lines into the file:
function net = getLogoNetwork() data = getLogoData(); net = data.convnet; end function data = getLogoData() if ~isfile('LogoNet.mat') url = 'https://www.mathworks.com/supportfiles/gpucoder/cnn_models/logo_detection/LogoNet.mat'; websave('LogoNet.mat',url); end data = load('LogoNet.mat'); end
snet = getLogoNetwork(); hT = dlhdl.Target('Xilinx'); hW = dlhdl.Workflow('Network','snet','Bitstream','zcu102_single','target',hT); image = imread('heineken.png'); inputImg = imresize(image, [227, 227]); imIn = single(inputImg); results = hW.activations(imIn,'maxpool_3','Profiler','on');
The result of the code execution is a 25-by-25-by-384 matrix for
results
and
Deep Learning Processor Profiler Performance Results LastLayerLatency(cycles) LastLayerLatency(seconds) FramesNum Total Latency Frames/s ------------- ------------- --------- --------- --------- Network 32497812 0.14772 1 32497822 6.8 conv_module 32497812 0.14772 conv_1 6953894 0.03161 maxpool_1 3305128 0.01502 conv_2 10397281 0.04726 maxpool_2 1207938 0.00549 conv_3 9267269 0.04212 maxpool_3 1366383 0.00621 * The clock frequency of the DL processor is: 220MHz