Optimizer_cpu>Optimizer_cpu.maximization (Calls: 900, Time: 2.795 sec)
Generated 28-May-2016 14:58:45 using performance time.
class method in file /home/johs/work/clustering/src/Optimizer_cpu.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
Optimizer_cpu>Optimizer_cpu.MoGEM | class method | 900 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
121 | w = repmat(weights(i,:), o.nfe... | 5400 | 1.094 s | 39.1% | ![]() |
124 | o.Sigma(:,:,i) = (mu_deviation... | 5400 | 1.006 s | 36.0% | ![]() |
122 | o.mu(:,i) = sum(w.*samples,2) ... | 5400 | 0.408 s | 14.6% | ![]() |
123 | mu_deviation = samples - repma... | 5400 | 0.193 s | 6.9% | ![]() |
117 | o.P = mean(weights,2); | 900 | 0.079 s | 2.8% | ![]() |
All other lines | 0.016 s | 0.6% | ![]() | ||
Totals | 2.795 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
mean | function | 900 | 0.072 s | 2.6% | ![]() |
Self time (built-ins, overhead, etc.) | 2.723 s | 97.4% | ![]() | ||
Totals | 2.795 s | 100% |
Line number | Message |
Total lines in function | 17 |
Non-code lines (comments, blank lines) | 1 |
Code lines (lines that can run) | 16 |
Code lines that did run | 10 |
Code lines that did not run | 6 |
Coverage (did run/can run) | 62.50 % |
time | Calls | line | |
---|---|---|---|
116 | function [o] = maximization(o, weights, samples) | ||
0.08 | 900 | 117 | o.P = mean(weights,2); |
< 0.01 | 900 | 118 | for i = 1:o.nclass |
< 0.01 | 5400 | 119 | weight_share = o.P(i) * o.nsample; |
< 0.01 | 5400 | 120 | if weight_share >= 2 |
1.09 | 5400 | 121 | w = repmat(weights(i,:), o.nfeature, 1); |
0.41 | 5400 | 122 | o.mu(:,i) = sum(w.*samples,2) / weight_share; |
0.19 | 5400 | 123 | mu_deviation = samples - repmat(o.mu(:,i), 1, o.nsample); |
1.01 | 5400 | 124 | o.Sigma(:,:,i) = (mu_deviation * (w.*mu_deviation)') / weight_share; |
125 | else | ||
126 | fprintf('%-10s %10.6f %10.6f class %d\n', 'SINGULAR', 0, 0, i-1); | ||
127 | o.P(i) = 1/o.nclass; | ||
128 | o.mu(:,i) = samples(:,1+round(N-1)*rand); | ||
129 | o.Sigma(:,:,i) = cov(samples') / o.nclass; | ||
130 | end | ||
< 0.01 | 5400 | 131 | end |
< 0.01 | 900 | 132 | end |
Other subfunctions in this file are not included in this listing.