Commit 73b54620 authored by Davis King's avatar Davis King

Added an overload of pick_initial_centers() that uses the linear kernel when no

other kernel is specified by the user.
parent d5b5c281
......@@ -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 <
......
......@@ -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 <
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment