This is a static copy of a profile report

Home

Function details for CG>JTBJvThis is a static copy of a profile report

Home

CG>JTBJv (Calls: 72, Time: 431.982 s)
Generated 19-Jun-2021 04:39:10 using performance time.
subfunction in file /nfs/inm_phd/07/d07944009/2021/0618-proj6/simpleNN/MATLAB/opt/CG.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
CGfunction72
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
79
p = sum(reshape(net.dzdS{m}, d...
216156.483 s36.2%
108
u_m = [u_m*net.phiZ{m}' sum(u_...
21684.374 s19.5%
105
u_m = sum(reshape(u_m, [], nL,...
21678.541 s18.2%
104
u_m = reshape(net.dzdS{m}, [],...
21674.620 s17.3%
78
p = p(:, 1:end-1)*net.phiZ{m} ...
21637.364 s8.6%
All other lines  0.599 s0.1%
Totals  431.982 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
gpufunction1440.024 s0.0%
Self time (built-ins, overhead, etc.)  431.958 s100.0%
Totals  431.982 s100% 
Code Analyzer results
Line numberMessage
50Input argument 'param' might be unused, although a later one is used. Consider replacing it by ~.
99The value assigned to variable 'a' might be unused.
100The value assigned to variable 'b' might be unused.
Coverage results
Show coverage for parent directory
Total lines in function61
Non-code lines (comments, blank lines)16
Code lines (lines that can run)45
Code lines that did run45
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
time 
Calls 
 line
  50 
function u = JTBJv(data, param, model, net, v)
  51 

< 0.001 
     72 
  52
L = model.L; 
< 0.001 
     72 
  53
LC = model.LC; 
< 0.001 
     72 
  54
nL = model.nL; 
< 0.001 
     72 
  55
num_data = size(data, 2); 
< 0.001 
     72 
  56
var_ptr = model.var_ptr; 
< 0.001 
     72 
  57
n = var_ptr(end) - 1; 
  0.022 
     72 
  58
u = gpu(@zeros, [n, 1]); 
  59 

  60 
% Jv
  0.009 
     72 
  61
Jv = gpu(@zeros, [nL*num_data, 1]); 
< 0.001 
     72 
  62
for m = L : -1 : LC+1 
  0.002 
     72 
  63
	var_range = var_ptr(m) : var_ptr(m+1) - 1; 
< 0.001 
     72 
  64
	n_m = model.full_neurons(m-LC); 
  65 

  0.007 
     72 
  66
	p = reshape(v(var_range), n_m, []); 
  0.128 
     72 
  67
	p = p(:, 1:end-1)*net.Z{m} + p(:, end); 
  0.049 
     72 
  68
	p = sum(reshape(net.dzdS{m}, n_m, nL, []) .* reshape(p, n_m, 1, []),1); 
  0.003 
     72 
  69
	Jv = Jv + p(:); 
< 0.001 
     72 
  70
end 
  71 

< 0.001 
     72 
  72
for m = LC : -1 : 1 
  0.017 
    216 
  73
	var_range = var_ptr(m) : var_ptr(m+1) - 1; 
  0.002 
    216 
  74
	d = model.ch_input(m+1); 
  0.002 
    216 
  75
	ab = model.ht_conv(m)*model.wd_conv(m); 
  76 

  0.048 
    216 
  77
	p = reshape(v(var_range), d, []); 
 37.364 
    216 
  78
	p = p(:, 1:end-1)*net.phiZ{m} + p(:, end); 
 156.483 
    216 
  79
	p = sum(reshape(net.dzdS{m}, d*ab, nL, []) .* reshape(p, d*ab, 1, []),1); 
  0.024 
    216 
  80
	Jv = Jv + p(:); 
  0.003 
    216 
  81
end 
  82 

  83 
% BJv
  0.004 
     72 
  84
Jv = 2*Jv; 
  85 

  86 
% JTBJv
  0.001 
     72 
  87
for m = L : -1 : LC+1 
  0.004 
     72 
  88
	var_range = var_ptr(m) : var_ptr(m+1) - 1; 
  89 

  0.023 
     72 
  90
	u_m = net.dzdS{m} .* Jv'; 
  0.013 
     72 
  91
	u_m = sum(reshape(u_m, [], nL, num_data), 2); 
  92 

  0.001 
     72 
  93
	u_m = reshape(u_m, [], num_data); 
  0.113 
     72 
  94
	u_m = [u_m*net.Z{m}' sum(u_m, 2)]; 
  0.012 
     72 
  95
	u(var_range) = u(var_range) + u_m(:); 
< 0.001 
     72 
  96
end 
  97 

< 0.001 
     72 
  98
for m = LC : -1 : 1 
  0.002 
    216 
  99
	a = model.ht_conv(m); 
< 0.001 
    216 
 100
	b = model.wd_conv(m); 
< 0.001 
    216 
 101
	d = model.ch_input(m+1); 
  0.011 
    216 
 102
	var_range = var_ptr(m) : var_ptr(m+1) - 1; 
 103 

 74.620 
    216 
 104
	u_m = reshape(net.dzdS{m}, [], nL*num_data) .* Jv'; 
 78.541 
    216 
 105
	u_m = sum(reshape(u_m, [], nL, num_data), 2); 
 106 

  0.011 
    216 
 107
	u_m = reshape(u_m, d, []); 
 84.374 
    216 
 108
	u_m = [u_m*net.phiZ{m}' sum(u_m, 2)]; 
  0.075 
    216 
 109
	u(var_range) = u(var_range) + u_m(:); 
  0.003 
    216 
 110
end 

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