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
afa4fe0c
Commit
afa4fe0c
authored
Jan 05, 2015
by
Davis King
Browse files
Fixed some grammar and added a note about the bias term.
parent
a7e55c79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
examples/assignment_learning_ex.cpp
examples/assignment_learning_ex.cpp
+12
-11
No files found.
examples/assignment_learning_ex.cpp
View file @
afa4fe0c
...
...
@@ -18,14 +18,15 @@
best way to measure this goodness isn't obvious and therefore machine learning
methods are used.
The remainder of this example program will show you how to learn a goodness
function which is optimal, in a certain sense, for use with the Hungarian
algorithm. To do this, we will make a simple dataset of example associations
and use them to train a supervised machine learning method.
Finally, note that there is a whole example program dedicated to assignment learning
problems where you are trying to make an object tracker. So if that is what you are
interested in then read the learning_to_track_ex.cpp example program.
The remainder of this example will show you how to learn a goodness function
which is optimal, in a certain sense, for use with the Hungarian algorithm. To
do this, we will make a simple dataset of example associations and use them to
train a supervised machine learning method.
Finally, note that there is a whole example program dedicated to assignment
learning problems where you are trying to make an object tracker. So if that is
what you are interested in then take a look at the learning_to_track_ex.cpp
example program.
*/
...
...
@@ -96,9 +97,9 @@ struct feature_extractor
Recall that our task is to learn the "goodness of assignment" function for
use with the Hungarian algorithm. The dlib tools assume this function
can be written as:
match_score(l,r) == dot(w, PSI(l,r))
match_score(l,r) == dot(w, PSI(l,r))
+ bias
where l is an element of LHS, r is an element of RHS, w is a parameter vector,
and PSI() is a user supplied feature extractor.
bias is a scalar value,
and PSI() is a user supplied feature extractor.
This feature_extractor is where we implement PSI(). How you implement this
is highly problem dependent.
...
...
@@ -132,7 +133,7 @@ struct feature_extractor
is "good").
!*/
{
// Lets just use the squared difference between each vector as our features.
// Let
'
s just use the squared difference between each vector as our features.
// However, it should be emphasized that how to compute the features here is very
// problem dependent.
feats
=
squared
(
left
-
right
);
...
...
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