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
73b54620
Commit
73b54620
authored
Jan 19, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an overload of pick_initial_centers() that uses the linear kernel when no
other kernel is specified by the user.
parent
d5b5c281
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
kkmeans.h
dlib/svm/kkmeans.h
+19
-1
kkmeans_abstract.h
dlib/svm/kkmeans_abstract.h
+26
-0
No files found.
dlib/svm/kkmeans.h
View file @
73b54620
...
...
@@ -7,7 +7,7 @@
#include "../matrix/matrix_abstract.h"
#include "../algs.h"
#include "../serialize.h"
#include "kernel
_abstract
.h"
#include "kernel.h"
#include "../array.h"
#include "kcentroid.h"
#include "kkmeans_abstract.h"
...
...
@@ -361,6 +361,24 @@ namespace dlib
}
// ----------------------------------------------------------------------------------------
template
<
typename
vector_type1
,
typename
vector_type2
>
void
pick_initial_centers
(
long
num_centers
,
vector_type1
&
centers
,
const
vector_type2
&
samples
,
double
percentile
=
0
.
01
)
{
typedef
typename
vector_type1
::
value_type
sample_type
;
linear_kernel
<
sample_type
>
kern
;
pick_initial_centers
(
num_centers
,
centers
,
samples
,
kern
,
percentile
);
}
// ----------------------------------------------------------------------------------------
template
<
...
...
dlib/svm/kkmeans_abstract.h
View file @
73b54620
...
...
@@ -237,6 +237,32 @@ namespace dlib
- #centers == a vector containing the candidate centers found
!*/
// ----------------------------------------------------------------------------------------
template
<
typename
vector_type1
,
typename
vector_type2
>
void
pick_initial_centers
(
long
num_centers
,
vector_type1
&
centers
,
const
vector_type2
&
samples
,
double
percentile
=
0
.
01
);
/*!
requires
- num_centers > 1
- 0 <= percentile < 1
- samples.size() > 1
- vector_type1 == something with an interface compatible with std::vector
- vector_type2 == something with an interface compatible with std::vector
- Both centers and samples must be able to contain dlib::matrix based row or
column vectors.
ensures
- performs: pick_initial_centers(num_centers, centers, samples, linear_kernel<sample_type>(), percentile)
(i.e. this function is simply an overload that uses the linear kernel.
!*/
// ----------------------------------------------------------------------------------------
template
<
...
...
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