mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Simplified example program.
This commit is contained in:
parent
f1aecac5ac
commit
137b7f80c8
@ -116,7 +116,7 @@ struct feature_extractor
|
|||||||
unsigned long num_features() const
|
unsigned long num_features() const
|
||||||
{
|
{
|
||||||
// Return the dimensionality of feature vectors produced by get_features()
|
// Return the dimensionality of feature vectors produced by get_features()
|
||||||
return num_dims + 1;
|
return num_dims;
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_features (
|
void get_features (
|
||||||
@ -132,12 +132,10 @@ struct feature_extractor
|
|||||||
is "good").
|
is "good").
|
||||||
!*/
|
!*/
|
||||||
{
|
{
|
||||||
// We will have:
|
// Lets just use the squared difference between each vector as our features.
|
||||||
// - feats(i) == std::pow(left(i) - right(i), 2.0)
|
// However, it should be emphasized that how to compute the features here is very
|
||||||
// Except for the last element of feats which will be equal to 1 and
|
// problem dependent.
|
||||||
// therefore function as a bias term. Again, how you define this feature
|
feats = squared(left - right);
|
||||||
// extractor is highly problem dependent.
|
|
||||||
feats = join_cols(squared(left - right), ones_matrix<double>(1,1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user