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
f1f9a018
Commit
f1f9a018
authored
Dec 12, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some comments.
parent
3ecacdcc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
assignment_learning_ex.cpp
examples/assignment_learning_ex.cpp
+4
-4
No files found.
examples/assignment_learning_ex.cpp
View file @
f1f9a018
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
The assignment problem can be optimally solved using the well known Hungarian
The assignment problem can be optimally solved using the well known Hungarian
algorithm. However, this algorithm requires the user to supply some function
algorithm. However, this algorithm requires the user to supply some function
which measure the "goodness" of an individual association. In many cases the
which measure
s
the "goodness" of an individual association. In many cases the
best way to measure this goodness isn't obvious and therefore machine learning
best way to measure this goodness isn't obvious and therefore machine learning
methods are used.
methods are used.
...
@@ -38,8 +38,8 @@ using namespace dlib;
...
@@ -38,8 +38,8 @@ using namespace dlib;
In an association problem, we will talk about the "Left Hand Set" (LHS) and the
In an association problem, we will talk about the "Left Hand Set" (LHS) and the
"Right Hand Set" (RHS). The task will be to learn to map all elements of LHS to
"Right Hand Set" (RHS). The task will be to learn to map all elements of LHS to
unique elements of RHS. If an element of LHS can't be mapped to a unique element of
unique elements of RHS. If an element of LHS can't be mapped to a unique element of
RHS for
any
reason (e.g. LHS is bigger than RHS) then it can also be mapped to the
RHS for
some
reason (e.g. LHS is bigger than RHS) then it can also be mapped to the
special -1 output
indicating no mapping
.
special -1 output
, indicating no mapping to RHS
.
So the first step is to define the type of elements in each of these sets. In the
So the first step is to define the type of elements in each of these sets. In the
code below we will use column vectors in both LHS and RHS. However, in general,
code below we will use column vectors in both LHS and RHS. However, in general,
...
@@ -181,7 +181,7 @@ int main()
...
@@ -181,7 +181,7 @@ int main()
cout
<<
"predicted labels: "
<<
trans
(
vector_to_matrix
(
predicted_assignments
))
<<
endl
;
cout
<<
"predicted labels: "
<<
trans
(
vector_to_matrix
(
predicted_assignments
))
<<
endl
;
}
}
// We can also
call
this tool to compute the percentage of assignments predicted correctly.
// We can also
use
this tool to compute the percentage of assignments predicted correctly.
cout
<<
"training accuracy: "
<<
test_assignment_function
(
assigner
,
samples
,
labels
)
<<
endl
;
cout
<<
"training accuracy: "
<<
test_assignment_function
(
assigner
,
samples
,
labels
)
<<
endl
;
...
...
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