MCPcopy Create free account
hub / github.com/davisking/dlib / convert_to_decision_function

Function convert_to_decision_function

dlib/svm/empirical_kernel_map.h:20–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19 template <typename kernel_type, typename EXP>
20 const decision_function<kernel_type> convert_to_decision_function (
21 const projection_function<kernel_type>& project_funct,
22 const matrix_exp<EXP>& vect
23 )
24 {
25 // make sure requires clause is not broken
26 DLIB_ASSERT(project_funct.out_vector_size() > 0 && is_vector(vect) &&
27 project_funct.out_vector_size() == vect.size() && project_funct.weights.nc() == project_funct.basis_vectors.size(),
28 "\t const decision_function convert_to_decision_function()"
29 << "\n\t Invalid inputs to this function."
30 << "\n\t project_funct.out_vector_size(): " << project_funct.out_vector_size()
31 << "\n\t project_funct.weights.nc(): " << project_funct.weights.nc()
32 << "\n\t project_funct.basis_vectors.size(): " << project_funct.basis_vectors.size()
33 << "\n\t is_vector(vect): " << is_vector(vect)
34 << "\n\t vect.size(): " << vect.size()
35 );
36
37 return decision_function<kernel_type>(trans(project_funct.weights)*vect,
38 0,
39 project_funct.kernel_function,
40 project_funct.basis_vectors);
41 }
42
43// ----------------------------------------------------------------------------------------
44

Callers 1

test_with_kernelMethod · 0.85

Calls 5

is_vectorFunction · 0.50
transFunction · 0.50
out_vector_sizeMethod · 0.45
sizeMethod · 0.45
ncMethod · 0.45

Tested by 1

test_with_kernelMethod · 0.68