This is a static copy of a profile report

Home

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

Home

newton>update_weights (Calls: 5, Time: 0.018 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
newtonfunction5
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
80
model.weight{m} = model.weight...
200.005 s29.6%
79
X = reshape(x(range), channel_...
200.004 s23.5%
78
range = var_ptr(m):var_ptr(m+1...
200.002 s11.5%
81
model.bias{m} = model.bias{m} ...
200.002 s10.4%
77
for m = 1 : model.L
50.001 s7.7%
All other lines  0.003 s17.3%
Totals  0.018 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function16
Non-code lines (comments, blank lines)3
Code lines (lines that can run)13
Code lines that did run11
Code lines that did not run2
Coverage (did run/can run)84.62 %
Function listing
time 
Calls 
 line
  67 
function model = update_weights(model, alpha, x)
  68 

< 0.001 
      5 
  69
if alpha == 1 
< 0.001 
      5 
  70
	old_alpha = 0; 
  71 
else
  72 
	old_alpha = alpha / 0.5;
< 0.001 
      5 
  73
end 
  74 

< 0.001 
      5 
  75
var_ptr = model.var_ptr; 
  0.001 
      5 
  76
channel_and_neurons = [model.ch_input; model.full_neurons]; 
  0.001 
      5 
  77
for m = 1 : model.L 
  0.002 
     20 
  78
	range = var_ptr(m):var_ptr(m+1)-1; 
  0.004 
     20 
  79
	X = reshape(x(range), channel_and_neurons(m+1), []); 
  0.005 
     20 
  80
	model.weight{m} = model.weight{m} + (alpha - old_alpha) * X(:, 1:end-1); 
  0.002 
     20 
  81
	model.bias{m} = model.bias{m} + (alpha - old_alpha) * X(:, end); 
< 0.001 
     20 
  82
end 

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