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
Function Name | Function Type | Calls |
JTv | function | 2850 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
42 | vTP = accumarray(idx(:), V(:),... | 2850 | 577.111 s | 81.2% | ![]() |
43 | end | 2850 | 84.371 s | 11.9% | ![]() |
29 | idx = net.idx_phiZ{m}(:) + [0:... | 1140 | 43.844 s | 6.2% | ![]() |
13 | idx = net.idx_pool{m} + gpu([0... | 1710 | 5.551 s | 0.8% | ![]() |
11 | if strcmp(op, 'pool_gradient') | 1710 | 0.043 s | 0.0% | ![]() |
All other lines | 0.201 s | 0.0% | ![]() | ||
Totals | 711.122 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
gpu | function | 1710 | 0.139 s | 0.0% | ![]() |
Self time (built-ins, overhead, etc.) | 710.982 s | 100.0% | ![]() | ||
Totals | 711.122 s | 100% |
Line number | Message |
13 | If you intend to specify expression precedence, use parentheses () instead of brackets []. |
16 | If you intend to specify expression precedence, use parentheses () instead of brackets []. |
29 | If you intend to specify expression precedence, use parentheses () instead of brackets []. |
Total lines in function | 43 |
Non-code lines (comments, blank lines) | 7 |
Code lines (lines that can run) | 36 |
Code lines that did run | 23 |
Code lines that did not run | 13 |
Coverage (did run/can run) | 63.89 % |
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.