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

Class projection_function

dlib/svm/function_abstract.h:708–794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

706 typename K
707 >
708 struct projection_function
709 {
710 /*!
711 REQUIREMENTS ON K
712 K must be a kernel function object type as defined at the
713 top of dlib/svm/kernel_abstract.h
714
715 WHAT THIS OBJECT REPRESENTS
716 This object represents a function that takes a data sample and projects
717 it into kernel feature space. The result is a real valued column vector that
718 represents a point in a kernel feature space.
719
720 THREAD SAFETY
721 It is always safe to use distinct instances of this object in different
722 threads. However, when a single instance is shared between threads then
723 the following rules apply:
724 Instances of this object have a mutable cache which is used by const
725 member functions. Therefore, it is not safe to use one instance of
726 this object from multiple threads (unless protected by a mutex).
727 !*/
728
729 typedef K kernel_type;
730 typedef typename K::scalar_type scalar_type;
731 typedef typename K::sample_type sample_type;
732 typedef typename K::mem_manager_type mem_manager_type;
733
734 typedef matrix<scalar_type,0,1,mem_manager_type> scalar_vector_type;
735 typedef matrix<scalar_type,0,0,mem_manager_type> scalar_matrix_type;
736 typedef matrix<sample_type,0,1,mem_manager_type> sample_vector_type;
737 typedef scalar_vector_type result_type;
738
739 scalar_matrix_type weights;
740 K kernel_function;
741 sample_vector_type basis_vectors;
742
743 projection_function (
744 );
745 /*!
746 ensures
747 - #weights.size() == 0
748 - #basis_vectors.size() == 0
749 !*/
750
751 projection_function (
752 const scalar_matrix_type& weights_,
753 const K& kernel_function_,
754 const sample_vector_type& basis_vectors_
755 ) : weights(weights_), kernel_function(kernel_function_), basis_vectors(basis_vectors_) {}
756 /*!
757 ensures
758 - populates the projection function with the given basis vectors, weights,
759 and kernel function.
760 !*/
761
762 long out_vector_size (
763 ) const;
764 /*!
765 ensures

Callers

nothing calls this directly

Calls 1

kernel_matrixFunction · 0.85

Tested by

no test coverage detected