Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
931fb526
Commit
931fb526
authored
Jan 12, 2020
by
Davis King
Browse files
fixed test not building due to the commit I just made
parent
59d1b9d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
dlib/test/oca.cpp
dlib/test/oca.cpp
+14
-14
No files found.
dlib/test/oca.cpp
View file @
931fb526
...
@@ -66,13 +66,13 @@ namespace
...
@@ -66,13 +66,13 @@ namespace
oca
solver
;
oca
solver
;
// test the version without a non-negativity constraint on w.
// test the version without a non-negativity constraint on w.
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
0
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
0
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
-
0.5
,
0.5
,
0
;
true_w
=
-
0.5
,
0.5
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
solver
.
solve_with_elastic_net
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
0.5
);
solver
.
solve_with_elastic_net
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
0.5
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
-
0.5
,
0.5
,
0
;
true_w
=
-
0.5
,
0.5
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
...
@@ -81,35 +81,35 @@ namespace
...
@@ -81,35 +81,35 @@ namespace
print_spinner
();
print_spinner
();
w_type
prior
=
true_w
;
w_type
prior
=
true_w
;
solver
(
make_oca_problem_c_svm
<
w_type
>
(
20.0
,
30.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
prior
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
20.0
,
30.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
prior
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
-
0.5
,
0.5
,
0
;
true_w
=
-
0.5
,
0.5
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
prior
=
0
,
0
,
0
;
prior
=
0
,
0
,
0
;
solver
(
make_oca_problem_c_svm
<
w_type
>
(
20.0
,
30.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
prior
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
20.0
,
30.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
prior
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
-
0.5
,
0.5
,
0
;
true_w
=
-
0.5
,
0.5
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
prior
=
-
1
,
1
,
0
;
prior
=
-
1
,
1
,
0
;
solver
(
make_oca_problem_c_svm
<
w_type
>
(
20.0
,
30.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
prior
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
20.0
,
30.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
prior
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
-
1.0
,
1.0
,
0
;
true_w
=
-
1.0
,
1.0
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
prior
=
-
0.2
,
0.2
,
0
;
prior
=
-
0.2
,
0.2
,
0
;
solver
(
make_oca_problem_c_svm
<
w_type
>
(
20.0
,
30.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
prior
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
20.0
,
30.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
prior
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
-
0.5
,
0.5
,
0
;
true_w
=
-
0.5
,
0.5
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
prior
=
-
10.2
,
-
1
,
0
;
prior
=
-
10.2
,
-
1
,
0
;
solver
(
make_oca_problem_c_svm
<
w_type
>
(
20.0
,
30.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
prior
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
20.0
,
30.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
prior
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
-
10.2
,
-
1.0
,
0
;
true_w
=
-
10.2
,
-
1.0
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
...
@@ -118,7 +118,7 @@ namespace
...
@@ -118,7 +118,7 @@ namespace
print_spinner
();
print_spinner
();
// test the version with a non-negativity constraint on w.
// test the version with a non-negativity constraint on w.
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
9999
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
9999
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
0
,
1
,
0
;
true_w
=
0
,
1
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
...
@@ -134,7 +134,7 @@ namespace
...
@@ -134,7 +134,7 @@ namespace
print_spinner
();
print_spinner
();
// test the version with a non-negativity constraint on w.
// test the version with a non-negativity constraint on w.
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
2
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
2
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
0
,
1
,
0
;
true_w
=
0
,
1
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
...
@@ -144,7 +144,7 @@ namespace
...
@@ -144,7 +144,7 @@ namespace
// test the version with a non-negativity constraint on w.
// test the version with a non-negativity constraint on w.
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
1
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
1
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
0
,
1
,
0
;
true_w
=
0
,
1
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
...
@@ -159,7 +159,7 @@ namespace
...
@@ -159,7 +159,7 @@ namespace
y
.
push_back
(
+
1
);
y
.
push_back
(
+
1
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
0
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
0
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
0.5
,
-
0.5
,
0
;
true_w
=
0.5
,
-
0.5
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
...
@@ -167,7 +167,7 @@ namespace
...
@@ -167,7 +167,7 @@ namespace
print_spinner
();
print_spinner
();
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
1
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
1
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
0.5
,
-
0.5
,
0
;
true_w
=
0.5
,
-
0.5
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
...
@@ -175,7 +175,7 @@ namespace
...
@@ -175,7 +175,7 @@ namespace
print_spinner
();
print_spinner
();
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
2
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
2
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
1
,
0
,
0
;
true_w
=
1
,
0
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
...
@@ -183,7 +183,7 @@ namespace
...
@@ -183,7 +183,7 @@ namespace
print_spinner
();
print_spinner
();
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
,
max_index_plus_one
(
x
)),
w
,
5
);
solver
(
make_oca_problem_c_svm
<
w_type
>
(
2.0
,
3.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
0.0
,
40
,
max_index_plus_one
(
x
)),
w
,
5
);
dlog
<<
LINFO
<<
trans
(
w
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
1
,
0
,
0
;
true_w
=
1
,
0
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment