This is a static copy of a profile report

Home

Function details for cnn_train>parameterThis is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
cnn_trainfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
85
param = parse_options(param, o...
10.024 s59.3%
65
gpu_use = (gpuDeviceCount >...
10.015 s37.1%
47
param.GNsize = ceil(0.05*size(...
10.000 s0.5%
38
param = struct;
10.000 s0.4%
61
global gpu_use;
10.000 s0.3%
All other lines  0.001 s2.3%
Totals  0.040 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
cnn_train>parse_optionssubfunction10.024 s58.5%
gpuDeviceCountfunction10.004 s9.7%
Self time (built-ins, overhead, etc.)  0.013 s31.8%
Totals  0.040 s100% 
Code Analyzer results
Line numberMessage
Coverage results
Show coverage for parent directory
Total lines in function72
Non-code lines (comments, blank lines)24
Code lines (lines that can run)48
Code lines that did run40
Code lines that did not run8
Coverage (did run/can run)83.33 %
Function listing
time 
Calls 
 line
  36 
function param = parameter(Z, options)
  37 

< 0.001 
      1 
  38
param = struct; 
  39 

< 0.001 
      1 
  40
param.solver = 1; 
< 0.001 
      1 
  41
param.C = 0.01; 
< 0.001 
      1 
  42
param.bsize = []; 
  43 

  44 
% parameters for Newton methods
  45 

  46 
% The subsampled size for calculating the Gauss-Newton matrix
< 0.001 
      1 
  47
param.GNsize = ceil(0.05*size(Z,1)); 
  48 
% The maximum number of Newton iterations
< 0.001 
      1 
  49
param.iter_max = 100; 
  50 
% CG
< 0.001 
      1 
  51
param.xi = 0.1; 
< 0.001 
      1 
  52
param.CGmax = 250; 
  53 
% Levenberg-Marquardt method
< 0.001 
      1 
  54
param.lambda = 1; 
< 0.001 
      1 
  55
param.drop = 2/3; 
< 0.001 
      1 
  56
param.boost = 3/2; 
  57 
% line search
< 0.001 
      1 
  58
param.eta = 1e-4; 
  59 

  60 
% Check GPU device
< 0.001 
      1 
  61
global gpu_use; 
< 0.001 
      1 
  62
if exist('OCTAVE_VERSION', 'builtin') 
  63 
	gpu_use = false;
< 0.001 
      1 
  64
else 
  0.015 
      1 
  65
	gpu_use = (gpuDeviceCount > 0); 
< 0.001 
      1 
  66
end 
  67 

  68 
% floating-point type and the flag of storing Jacobian
< 0.001 
      1 
  69
global float_type; 
< 0.001 
      1 
  70
float_type = []; 
< 0.001 
      1 
  71
param.Jacobian = []; 
  72 

  73 
% parameters for stochastic gradient
  74 

< 0.001 
      1 
  75
param.epoch_max = 500; 
< 0.001 
      1 
  76
param.lr = 0.01; 
< 0.001 
      1 
  77
if param.solver == 3 
  78 
	param.lr = 0.001;
< 0.001 
      1 
  79
end 
< 0.001 
      1 
  80
param.decay = 0; 
< 0.001 
      1 
  81
param.momentum = 0; 
  82 

  83 
% Read options given by users
< 0.001 
      1 
  84
if ~isempty(options) 
  0.024 
      1 
  85
	param = parse_options(param, options); 
< 0.001 
      1 
  86
end 
  87 

< 0.001 
      1 
  88
if isempty(float_type) 
  89 
    if gpu_use
  90 
        float_type = 'single';
  91 
    else
  92 
        float_type = 'double';
  93 
    end
< 0.001 
      1 
  94
end 
  95 

< 0.001 
      1 
  96
if isempty(param.Jacobian) 
  97 
    param.Jacobian = ~gpu_use;
< 0.001 
      1 
  98
end 
  99 

< 0.001 
      1 
 100
if isempty(param.bsize) 
< 0.001 
      1 
 101
	param.bsize = 128; 
< 0.001 
      1 
 102
	if ~gpu_use && (param.solver == 1) 
< 0.001 
      1 
 103
		param.bsize = 1024; 
< 0.001 
      1 
 104
	end 
< 0.001 
      1 
 105
end 
 106 

< 0.001 
      1 
 107
param.C = param.C*size(Z,1); 

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