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: 1795, Time: 605.626 s)
Generated 19-Jun-2021 04:39:10 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
JTvfunction1770
Jacobian>cal_dzdSsubfunction25
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
42
vTP = accumarray(idx(:), V(:),...
1795497.959 s82.2%
43
end
179565.548 s10.8%
29
idx = net.idx_phiZ{m}(:) + [0:...
71837.078 s6.1%
13
idx = net.idx_pool{m} + gpu([0...
10623.693 s0.6%
16
idx = reshape(net.idx_pool{m},...
151.192 s0.2%
All other lines  0.154 s0.0%
Totals  605.626 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
gpufunction10770.078 s0.0%
Self time (built-ins, overhead, etc.)  605.547 s100.0%
Totals  605.626 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 run28
Code lines that did not run8
Coverage (did run/can run)77.78 %
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.008 
   1795 
   4
nL = model.nL; 
   5 

< 0.001 
   1795 
   6
switch op 
  0.023 
   1795 
   7
case {'pool_gradient', 'pool_Jacobian'} 
  0.002 
   1077 
   8
	a_prev = model.ht_conv(m); 
  0.002 
   1077 
   9
	b_prev = model.wd_conv(m); 
  0.002 
   1077 
  10
	d_prev = model.ch_input(m+1); 
  0.025 
   1077 
  11
	if strcmp(op, 'pool_gradient') 
< 0.001 
   1062 
  12
		num_v = num_data; 
  3.693 
   1062 
  13
		idx = net.idx_pool{m} + gpu([0:num_data-1])*d_prev*a_prev*b_prev; 
< 0.001 
     15 
  14
	else 
< 0.001 
     15 
  15
		num_v = nL*num_data; 
  1.192 
     15 
  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 
   1077 
  17
	end 
  0.005 
    718 
  18
case {'phi_gradient', 'phi_Jacobian'} 
  0.003 
    718 
  19
	a_prev = model.ht_pad(m); 
  0.001 
    718 
  20
	b_prev = model.wd_pad(m); 
  0.001 
    718 
  21
	d_prev = model.ch_input(m); 
  22 

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

 37.078 
    718 
  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 
   1795 
  32
end 
  33 

  0.018 
   1795 
  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 
   1795 
  41
else 
 497.959 
   1795 
  42
	vTP = accumarray(idx(:), V(:), [d_prev*a_prev*b_prev*num_v 1])'; 
 65.548 
   1795 
  43
end 

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