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
| Function Name | Function Type | Calls |
| JTv | function | 1770 |
| Jacobian>cal_dzdS | subfunction | 25 |
| Line Number | Code | Calls | Total Time | % Time | Time Plot |
| 42 | vTP = accumarray(idx(:), V(:),... | 1795 | 497.959 s | 82.2% | |
| 43 | end | 1795 | 65.548 s | 10.8% | |
| 29 | idx = net.idx_phiZ{m}(:) + [0:... | 718 | 37.078 s | 6.1% | |
| 13 | idx = net.idx_pool{m} + gpu([0... | 1062 | 3.693 s | 0.6% | |
| 16 | idx = reshape(net.idx_pool{m},... | 15 | 1.192 s | 0.2% | |
| All other lines | 0.154 s | 0.0% | |||
| Totals | 605.626 s | 100% |
| Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
| gpu | function | 1077 | 0.078 s | 0.0% | |
| Self time (built-ins, overhead, etc.) | 605.547 s | 100.0% | |||
| Totals | 605.626 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 | 28 |
| Code lines that did not run | 8 |
| Coverage (did run/can run) | 77.78 % |
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.