mirror of https://github.com/davisking/dlib.git
Added another overload of test_ranking_function() that takes a single
ranking_pair. Also improved wording of comment in svm_rank_trainer_abstract.h
This commit is contained in:
parent
41d47e98e0
commit
ee3a8692bf
|
@ -243,6 +243,20 @@ namespace dlib
|
|||
return static_cast<double>(total_pairs - total_wrong) / total_pairs;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
template <
|
||||
typename ranking_function,
|
||||
typename T
|
||||
>
|
||||
double test_ranking_function (
|
||||
const ranking_function& funct,
|
||||
const ranking_pair<T>& sample
|
||||
)
|
||||
{
|
||||
return test_ranking_function(funct, std::vector<ranking_pair<T> >(1,sample));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
template <
|
||||
|
|
|
@ -178,6 +178,28 @@ namespace dlib
|
|||
(for all valid i,j,k)
|
||||
!*/
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
template <
|
||||
typename ranking_function,
|
||||
typename T
|
||||
>
|
||||
double test_ranking_function (
|
||||
const ranking_function& funct,
|
||||
const ranking_pair<T>& sample
|
||||
);
|
||||
/*!
|
||||
requires
|
||||
- is_ranking_problem(std::vector<ranking_pair<T> >(1, sample)) == true
|
||||
- ranking_function == some kind of decision function object (e.g. decision_function)
|
||||
ensures
|
||||
- This is just a convenience routine for calling the above
|
||||
test_ranking_function() routine. That is, it just copies sample into a
|
||||
std::vector object and invokes the above test_ranking_function() routine.
|
||||
This means that calling this function is equivalent to invoking:
|
||||
return test_ranking_function(funct, std::vector<ranking_pair<T> >(1, sample));
|
||||
!*/
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
template <
|
||||
|
|
|
@ -218,9 +218,9 @@ namespace dlib
|
|||
- is_ranking_problem(std::vector<ranking_pair<sample_type> >(1, sample)) == true
|
||||
ensures
|
||||
- This is just a convenience routine for calling the above train()
|
||||
function. That is, it just copies sample into an appropriate std::vector
|
||||
object and invokes the above train() method. That is, this function is
|
||||
equivalent to invoking:
|
||||
function. That is, it just copies sample into a std::vector object and
|
||||
invokes the above train() method. This means that calling this function
|
||||
is equivalent to invoking:
|
||||
return train(std::vector<ranking_pair<sample_type> >(1, sample));
|
||||
!*/
|
||||
|
||||
|
|
Loading…
Reference in New Issue