Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
c67975c7
Commit
c67975c7
authored
Feb 10, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added code to test the oca interface with a prior vector.
parent
f25ca01e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
oca.cpp
dlib/test/oca.cpp
+35
-0
No files found.
dlib/test/oca.cpp
View file @
c67975c7
...
@@ -72,6 +72,41 @@ namespace
...
@@ -72,6 +72,41 @@ namespace
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
);
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
),
w
,
prior
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
-
0.5
,
0.5
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
prior
=
0
,
0
,
0
;
solver
(
make_oca_problem_c_svm
<
w_type
>
(
20.0
,
30.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
),
w
,
prior
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
-
0.5
,
0.5
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
prior
=
-
1
,
1
,
0
;
solver
(
make_oca_problem_c_svm
<
w_type
>
(
20.0
,
30.0
,
mat
(
x
),
mat
(
y
),
false
,
1e-12
,
40
),
w
,
prior
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
-
1.0
,
1.0
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
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
),
w
,
prior
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
-
0.5
,
0.5
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
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
),
w
,
prior
);
dlog
<<
LINFO
<<
trans
(
w
);
true_w
=
-
10.2
,
-
1.0
,
0
;
dlog
<<
LINFO
<<
"error: "
<<
max
(
abs
(
w
-
true_w
));
DLIB_TEST
(
max
(
abs
(
w
-
true_w
))
<
1e-10
);
print_spinner
();
print_spinner
();
// test the version with a non-negativity constraint on w.
// test the version with a non-negativity constraint on 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