This is a static copy of a profile report

Home

Function details for vTPThis is a static copy of a profile report

Home

vTP (Calls: 2850, Time: 711.122 s)
Generated 19-Jun-2021 04:01:57 using performance time.
function in file /nfs/inm_phd/07/d07944009/2021/0618-proj6/simpleNN/MATLAB/cnn/vTP.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
JTvfunction2850
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
42
vTP = accumarray(idx(:), V(:),...
2850577.111 s81.2%
43
end
285084.371 s11.9%
29
idx = net.idx_phiZ{m}(:) + [0:...
114043.844 s6.2%
13
idx = net.idx_pool{m} + gpu([0...
17105.551 s0.8%
11
if strcmp(op, 'pool_gradient')
17100.043 s0.0%
All other lines  0.201 s0.0%
Totals  711.122 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
gpufunction17100.139 s0.0%
Self time (built-ins, overhead, etc.)  710.982 s100.0%
Totals  711.122 s100% 
Code Analyzer results
Line numberMessage
13If you intend to specify expression precedence, use parentheses () instead of brackets [].
16If you intend to specify expression precedence, use parentheses () instead of brackets [].
29If you intend to specify expression precedence, use parentheses () instead of brackets [].
Coverage results
Show coverage for parent directory
Total lines in function43
Non-code lines (comments, blank lines)7
Code lines (lines that can run)36
Code lines that did run23
Code lines that did not run13
Coverage (did run/can run)63.89 %
Function listing
time 
Calls 
 line
   1 
function vTP = vTP(model, net, m, num_data, V, op)
   2 
% output vTP: a row vector, where mat(vTP) is with dimension $d_prev a_prev b_prev \times num_v$.
   3 

  0.013 
   2850 
   4
nL = model.nL; 
   5 

< 0.001 
   2850 
   6
switch op 
  0.041 
   2850 
   7
case {'pool_gradient', 'pool_Jacobian'} 
  0.003 
   1710 
   8
	a_prev = model.ht_conv(m); 
  0.003 
   1710 
   9
	b_prev = model.wd_conv(m); 
  0.003 
   1710 
  10
	d_prev = model.ch_input(m+1); 
  0.043 
   1710 
  11
	if strcmp(op, 'pool_gradient') 
< 0.001 
   1710 
  12
		num_v = num_data; 
  5.551 
   1710 
  13
		idx = net.idx_pool{m} + gpu([0:num_data-1])*d_prev*a_prev*b_prev; 
  14 
	else
  15 
		num_v = nL*num_data;
  16 
		idx = reshape(net.idx_pool{m}, [], 1, num_data) + reshape(gpu([0:nL*num_data-1])*d_prev*a_prev*b_prev, 1, nL, num_data);
  0.001 
   1710 
  17
	end 
  0.008 
   1140 
  18
case {'phi_gradient', 'phi_Jacobian'} 
  0.004 
   1140 
  19
	a_prev = model.ht_pad(m); 
  0.002 
   1140 
  20
	b_prev = model.wd_pad(m); 
  0.002 
   1140 
  21
	d_prev = model.ch_input(m); 
  22 

  0.038 
   1140 
  23
	if strcmp(op, 'phi_gradient') 
< 0.001 
   1140 
  24
		num_v = num_data; 
  25 
	else
  26 
		num_v = nL*num_data;
< 0.001 
   1140 
  27
	end 
  28 

 43.844 
   1140 
  29
	idx = net.idx_phiZ{m}(:) + [0:num_v-1]*d_prev*a_prev*b_prev; 
  30 
otherwise
  31 
	error('Unknown operation in function vTP.');
< 0.001 
   2850 
  32
end 
  33 

  0.027 
   2850 
  34
if model.gpu_use 
  35 
	try
  36 
		vTP = accum(idx(:), V(:), [d_prev*a_prev*b_prev*num_v 1])';
  37 
	catch ME
  38 
		reset(gpuDevice(1));
  39 
		rethrow(ME);
  40 
	end
< 0.001 
   2850 
  41
else 
 577.111 
   2850 
  42
	vTP = accumarray(idx(:), V(:), [d_prev*a_prev*b_prev*num_v 1])'; 
 84.371 
   2850 
  43
end 

Other subfunctions in this file are not included in this listing.