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
137b7f80
Commit
137b7f80
authored
Apr 05, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified example program.
parent
f1aecac5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
assignment_learning_ex.cpp
examples/assignment_learning_ex.cpp
+5
-7
No files found.
examples/assignment_learning_ex.cpp
View file @
137b7f80
...
...
@@ -116,7 +116,7 @@ struct feature_extractor
unsigned
long
num_features
()
const
{
// Return the dimensionality of feature vectors produced by get_features()
return
num_dims
+
1
;
return
num_dims
;
}
void
get_features
(
...
...
@@ -132,12 +132,10 @@ struct feature_extractor
is "good").
!*/
{
// We will have:
// - feats(i) == std::pow(left(i) - right(i), 2.0)
// Except for the last element of feats which will be equal to 1 and
// therefore function as a bias term. Again, how you define this feature
// extractor is highly problem dependent.
feats
=
join_cols
(
squared
(
left
-
right
),
ones_matrix
<
double
>
(
1
,
1
));
// Lets 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