mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
made the rank_features() function work with any kind of
vector like object --HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402377
This commit is contained in:
parent
8c79cdfe81
commit
8284d6b03c
@ -19,7 +19,7 @@ namespace dlib
|
||||
typename sample_matrix_type,
|
||||
typename label_matrix_type
|
||||
>
|
||||
matrix<typename kernel_type::scalar_type,0,2,typename kernel_type::mem_manager_type> rank_features (
|
||||
matrix<typename kernel_type::scalar_type,0,2,typename kernel_type::mem_manager_type> rank_features_impl (
|
||||
const kcentroid<kernel_type>& kc,
|
||||
const sample_matrix_type& samples,
|
||||
const label_matrix_type& labels,
|
||||
@ -131,6 +131,23 @@ namespace dlib
|
||||
return results;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
template <
|
||||
typename kernel_type,
|
||||
typename sample_matrix_type,
|
||||
typename label_matrix_type
|
||||
>
|
||||
matrix<typename kernel_type::scalar_type,0,2,typename kernel_type::mem_manager_type> rank_features (
|
||||
const kcentroid<kernel_type>& kc,
|
||||
const sample_matrix_type& samples,
|
||||
const label_matrix_type& labels,
|
||||
const long num_features
|
||||
)
|
||||
{
|
||||
return rank_features_impl(kc, vector_to_matrix(samples), vector_to_matrix(labels), num_features);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
@ -27,12 +27,11 @@ namespace dlib
|
||||
);
|
||||
/*!
|
||||
requires
|
||||
- is_matrix<sample_matrix_type>::value == true
|
||||
(i.e. samples must be a dlib matrix object)
|
||||
- is_matrix<sample_matrix_type::type>::value == true
|
||||
(i.e. samples must also contain dlib matrix objects)
|
||||
- is_matrix<label_matrix_type>::value == true
|
||||
(i.e. labels must be a dlib matrix object)
|
||||
- vector_to_matrix(samples) == a valid matrix object
|
||||
- vector_to_matrix(samples(0)) == a valid matrix object
|
||||
- vector_to_matrix(labels) == a valid matrix object
|
||||
(i.e. the 3 above things must either be dlib::matrix objects or be
|
||||
convertable to them via the vector_to_matrix() function)
|
||||
- samples.nc() == 1 && labels.nc() == 1
|
||||
(i.e. samples and labels must be column vectors)
|
||||
- samples.size() == labels.size()
|
||||
|
Loading…
Reference in New Issue
Block a user