diff options
Diffstat (limited to 'SD-VBS/benchmarks/svm/src/matlab/examineExample.m')
-rw-r--r-- | SD-VBS/benchmarks/svm/src/matlab/examineExample.m | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/SD-VBS/benchmarks/svm/src/matlab/examineExample.m b/SD-VBS/benchmarks/svm/src/matlab/examineExample.m deleted file mode 100644 index a60ee13..0000000 --- a/SD-VBS/benchmarks/svm/src/matlab/examineExample.m +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | function [a,b,e,ret]=examineExample(i, a, b, C, e, X, Y, tolerance, N, eps, dim) | ||
2 | |||
3 | ret = 0; | ||
4 | if (a(i,1) > 0) && (a(i,1) < C) | ||
5 | E = e(i,1); | ||
6 | else | ||
7 | E = cal_learned_func(i, a, b, N, Y, X, dim) - Y(i,1); | ||
8 | end | ||
9 | |||
10 | r1 = Y(i,1) * E; | ||
11 | |||
12 | if (r1 < -1*tolerance && a(i,1) < C) || (r1 > tolerance && a(i,1) > 0) | ||
13 | %case1 argmax E-E2% | ||
14 | maxEDiff=0; | ||
15 | j=i; | ||
16 | for k=1:N | ||
17 | if a(k,1) > 0 && a(k,1) < C | ||
18 | temp= abs(E - e(k,1)); | ||
19 | if temp > maxEDiff | ||
20 | j=k; | ||
21 | end | ||
22 | end | ||
23 | end | ||
24 | |||
25 | if i~=j | ||
26 | [a,b,e,ret]=takeStep(i, j, a, C, e, Y, X, eps, b, N, dim); | ||
27 | end | ||
28 | |||
29 | if(ret ~=1) | ||
30 | %iterate through the non-bound example% | ||
31 | % for k=round(randWrapper(1,1)*(N-2))+1:N | ||
32 | randVal = 1.0; | ||
33 | for k=(randVal*(N-1)):N | ||
34 | if (a(k,1) > 0 && a(k,1) < C && ret == 0) | ||
35 | % if (i == k) | ||
36 | % ret = 0; | ||
37 | % else | ||
38 | [a,b,e,ret]=takeStep(i, k, a, C, e, Y, X, eps, b, N, dim); | ||
39 | % end | ||
40 | end | ||
41 | end | ||
42 | end | ||
43 | |||
44 | if(ret ~= 1) | ||
45 | %iter for entire training set% | ||
46 | for k=1:N | ||
47 | if(ret == 0) | ||
48 | % if (i == k) | ||
49 | % ret = 0; | ||
50 | % else | ||
51 | [a,b,e,ret]=takeStep(i, k, a, C, e, Y, X, eps, b, N, dim); | ||
52 | % end | ||
53 | end | ||
54 | end | ||
55 | end | ||
56 | |||
57 | else | ||
58 | |||
59 | end | ||
60 | |||