This is a static copy of a profile report

Home

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

Home

cnn_train>parse_options (Calls: 1, Time: 0.024 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_train>parametersubfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
111
options = strsplit(strtrim(opt...
10.019 s79.2%
120
value = str2num(options{2*i});
40.004 s17.2%
153
param.Jacobian = logical(value...
10.000 s0.5%
170
end
40.000 s0.5%
119
option = options{2*i-1};
40.000 s0.3%
All other lines  0.001 s2.3%
Totals  0.024 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
strsplitfunction10.008 s34.6%
str2numfunction40.001 s6.1%
Self time (built-ins, overhead, etc.)  0.014 s59.3%
Totals  0.024 s100% 
Code Analyzer results
Line numberMessage
120If you are operating on scalar values, consider using STR2DOUBLE for faster performance.
Coverage results
Show coverage for parent directory
Total lines in function62
Non-code lines (comments, blank lines)4
Code lines (lines that can run)58
Code lines that did run34
Code lines that did not run24
Coverage (did run/can run)58.62 %
Function listing
time 
Calls 
 line
 109 
function param = parse_options(param, options)
 110 

  0.019 
      1 
 111
options = strsplit(strtrim(options), ' '); 
 112 

< 0.001 
      1 
 113
if mod(length(options), 2) == 1 
 114 
	error('Each option is specified by its name and value.');
< 0.001 
      1 
 115
end 
 116 

< 0.001 
      1 
 117
global gpu_use float_type; 
< 0.001 
      1 
 118
for i = 1 : length(options)/2 
< 0.001 
      4 
 119
	option = options{2*i-1}; 
  0.004 
      4 
 120
	value = str2num(options{2*i}); 
< 0.001 
      4 
 121
	switch option 
< 0.001 
      4 
 122
		case '-s' 
< 0.001 
      1 
 123
			param.solver = value; 
< 0.001 
      3 
 124
		case '-GNsize' 
 125 
			param.GNsize = value;
< 0.001 
      3 
 126
		case '-iter_max' 
< 0.001 
      1 
 127
			param.iter_max = value; 
< 0.001 
      2 
 128
		case '-C' 
 129 
			param.C = value;
< 0.001 
      2 
 130
		case '-xi' 
 131 
			param.xi = value;
< 0.001 
      2 
 132
		case '-CGmax' 
 133 
			param.CGmax = value;
< 0.001 
      2 
 134
		case '-lambda' 
 135 
			param.lambda = value;
< 0.001 
      2 
 136
		case '-drop' 
 137 
			param.drop = value;
< 0.001 
      2 
 138
		case '-boost' 
 139 
			param.boost = value;
< 0.001 
      2 
 140
		case '-eta' 
 141 
			param.eta = value;
< 0.001 
      2 
 142
		case '-lr' 
 143 
			param.lr = value;
< 0.001 
      2 
 144
		case '-decay' 
 145 
			param.decay = value;
< 0.001 
      2 
 146
		case '-bsize' 
 147 
			param.bsize = value;
< 0.001 
      2 
 148
		case '-momentum' 
 149 
			param.momentum = value;
< 0.001 
      2 
 150
		case '-epoch_max' 
 151 
			param.epoch_max = value;
< 0.001 
      2 
 152
		case '-Jacobian' 
< 0.001 
      1 
 153
			param.Jacobian = logical(value); 
< 0.001 
      1 
 154
		case '-ftype' 
< 0.001 
      1 
 155
			if value == 0 
 156 
				float_type = 'single';
< 0.001 
      1 
 157
			elseif value == 1 
< 0.001 
      1 
 158
				float_type = 'double'; 
 159 
			else
 160 
				error('we do not support this float type');
< 0.001 
      1 
 161
			end 
 162 
		case '-gpu_use'
 163 
			if ~(gpu_use) && logical(value)
 164 
				error('we do not detect any gpuDevice.');
 165 
			end
 166 
			gpu_use = logical(value) && (exist('OCTAVE_VERSION', 'builtin') == 0);
 167 
		otherwise
 168 
			error('%s is not a supported option.', option);
< 0.001 
      4 
 169
	end 
< 0.001 
      4 
 170
end 

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