Optimizer_cpu>Optimizer_cpu.score (Calls: 9, Time: 0.327 sec)
Generated 28-May-2016 14:58:47 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 |
...ll_classes_within_confidence_interval | class method | 9 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
74 | weight_bins(b) = sum((bin_memb... | 2700 | 0.190 s | 58.1% | ![]() |
70 | edges = single(norminv((0:o.C.... | 135 | 0.048 s | 14.6% | ![]() |
71 | [~,~,bin_membership] = histcou... | 135 | 0.037 s | 11.2% | ![]() |
63 | threshold = chi2inv(cl, (o.C.N... | 9 | 0.036 s | 10.9% | ![]() |
72 | weight_bins = zeros(o.C.NPROBA... | 135 | 0.003 s | 0.9% | ![]() |
All other lines | 0.014 s | 4.3% | ![]() | ||
Totals | 0.327 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
histcounts | function | 135 | 0.030 s | 9.0% | ![]() |
chi2inv | function | 9 | 0.026 s | 8.0% | ![]() |
norminv | function | 135 | 0.007 s | 2.3% | ![]() |
Self time (built-ins, overhead, etc.) | 0.264 s | 80.7% | ![]() | ||
Totals | 0.327 s | 100% |
Line number | Message |
Total lines in function | 19 |
Non-code lines (comments, blank lines) | 2 |
Code lines (lines that can run) | 17 |
Code lines that did run | 17 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
time | Calls | line | |
---|---|---|---|
61 | function [scores] = score(o, weights, samples) | ||
< 0.01 | 9 | 62 | cl = 1 - (1-o.C.CONFIDENCE_LEVEL)/(o.nfeature*o.nclass); |
0.04 | 9 | 63 | threshold = chi2inv(cl, (o.C.NPROBABILITY_BINS - o.C.DOFS)); |
64 | |||
< 0.01 | 9 | 65 | classwise_share = sum(weights, 2); |
< 0.01 | 9 | 66 | scores = zeros(o.nfeature, o.nclass, 'single'); |
< 0.01 | 9 | 67 | for j = 1:o.nclass |
< 0.01 | 45 | 68 | expected_distribution = classwise_share(j)/o.C.NPROBABILITY_BINS; |
< 0.01 | 45 | 69 | for i = 1:o.nfeature |
0.05 | 135 | 70 | edges = single(norminv((0:o.C.NPROBABILITY_BINS)/o.C.NPROBABILITY_BINS, o.mu(i,j), sqrt(o.Sigma(i,i,j)))); |
0.04 | 135 | 71 | [~,~,bin_membership] = histcounts(samples(i,:), edges); |
< 0.01 | 135 | 72 | weight_bins = zeros(o.C.NPROBABILITY_BINS, 1, 'single'); |
< 0.01 | 135 | 73 | for b = 1:o.C.NPROBABILITY_BINS |
0.19 | 2700 | 74 | weight_bins(b) = sum((bin_membership==b) .* weights(j,:)); |
< 0.01 | 2700 | 75 | end |
< 0.01 | 135 | 76 | scores(i,j) = sum((weight_bins-expected_distribution).^2/expected_distribution) / threshold; |
< 0.01 | 135 | 77 | end |
< 0.01 | 45 | 78 | end |
< 0.01 | 9 | 79 | end |
Other subfunctions in this file are not included in this listing.