This is a static copy of a profile report

Home

Function details for newton>assign_inst_idxThis is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
newtonfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
96
perm_idx = randperm(l);
10.004 s60.7%
104
batch_idx{i} = perm_idx((i-1)*...
200.001 s13.4%
105
end
200.001 s12.5%
98
perm_idx = [perm_idx perm_idx(...
10.001 s10.3%
99
batch_idx = cell(num_splits,1)...
10.000 s1.0%
All other lines  0.000 s2.1%
Totals  0.007 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function13
Non-code lines (comments, blank lines)6
Code lines (lines that can run)7
Code lines that did run7
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
time 
Calls 
 line
  93 
function batch_idx = assign_inst_idx(GNsize, l)
  94 

< 0.001 
      1 
  95
num_splits = ceil(l/GNsize); 
  0.004 
      1 
  96
perm_idx = randperm(l); 
  97 
% ensure each subsampled Hessian has the same size
< 0.001 
      1 
  98
perm_idx = [perm_idx perm_idx(1:GNsize)]; 
< 0.001 
      1 
  99
batch_idx = cell(num_splits,1); 
 100 

< 0.001 
      1 
 101
for i = 1 : num_splits 
 102 
	% random selection instead of random split
 103 
	% batch_idx{i} = randperm(l, GNsize); 
< 0.001 
     20 
 104
	batch_idx{i} = perm_idx((i-1)*GNsize+1 : i*GNsize); 
< 0.001 
     20 
 105
end 

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