This is a static copy of a profile report

Home

Function details for exampleThis is a static copy of a profile report

Home

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

Parents (calling functions)
No parent
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
44
model = cnn_train(y, Z, [], []...
12206.187 s100.0%
45
profsave(profile('info'), save...
10.003 s0.0%
All other lines  0.000 s0.0%
Totals  2206.191 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
cnn_trainfunction12206.167 s100.0%
Self time (built-ins, overhead, etc.)  0.024 s0.0%
Totals  2206.191 s100% 
Code Analyzer results
Line numberMessage
44The value assigned to variable 'model' might be unused.
Coverage results
Show coverage for parent directory
Total lines in function45
Non-code lines (comments, blank lines)18
Code lines (lines that can run)27
Code lines that did run2
Code lines that did not run25
Coverage (did run/can run)7.41 %
Function listing
time 
Calls 
 line
   1 
function example(options, input_format, save_loc)
   2 

   3 
if nargin == 0
   4 
	options = '';
   5 
end
   6 
if nargin <= 1
   7 
	input_format = 0;
   8 
end
   9 
if (input_format ~= 0) && (input_format ~= 1)
  10 
	error('input_format must be 0 or 1.');
  11 
end
  12 

  13 
% To access read_config.m file in cnn directory
  14 
addpath(genpath('./cnn'));
  15 

  16 
%% Train
  17 
% ------
  18 
config_file = 'config/mnist-demo-layer4.config';
  19 
net_config = read_config(config_file);
  20 
a = net_config.ht_input(1);
  21 
b = net_config.wd_input(1);
  22 
d = net_config.ch_input(1);
  23 

  24 
% Read train data sets
  25 
load('data/mnist.mat', 'y', 'Z');
  26 
% Because sparse matrices stored in the provided mat file do not store zero columns in the end, we need to fill it.
  27 
Z = [full(Z) zeros(size(Z,1), a*b*d - size(Z,2))];
  28 

  29 
% If input data format is row-wise, we rearrange data from row-wise to col-wise
  30 
if input_format == 0
  31 
	Z = reshape(permute(reshape(Z, [],b,a,d), [1,3,2,4]), [], a*b*d);
  32 
end
  33 

  34 
% Normalization
  35 
Z = Z / 255;
  36 

  37 
% Zero mean
  38 
mean_tr = mean(Z);
  39 
Z = Z - mean_tr;
  40 

  41 
seed = 111;
  42 

  43 
profile on
 2206.187 
      1 
  44
model = cnn_train(y, Z, [], [], config_file, options, seed); 
  0.003 
      1 
  45
profsave(profile('info'), save_loc) 

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