Commit ff0e7f6e authored by Davis King's avatar Davis King

Added a premultiply_projections_by() function to the empirical_kernel_map.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403317
parent 55861855
......@@ -164,6 +164,23 @@ namespace dlib
return distance_function<kernel_type>(trans(weights)*vect, dot(vect,vect), kernel, vector_to_matrix(basis));
}
template <typename EXP>
void premultiply_projections_by (
const matrix_exp<EXP>& mat
)
{
// make sure requires clause is not broken
DLIB_ASSERT(out_vector_size() != 0 && mat.nc() == out_vector_size(),
"\t void empirical_kernel_map::premultiply_projections_by()"
<< "\n\t Invalid inputs to this function."
<< "\n\t out_vector_size(): " << out_vector_size()
<< "\n\t mat.nc(): " << mat.nc()
<< "\n\t this: " << this
);
weights = mat*weights;
}
const matrix<scalar_type,0,1,mem_manager_type>& project (
const sample_type& samp
) const
......
......@@ -122,6 +122,20 @@ namespace dlib
- returns 0
!*/
template <typename EXP>
void premultiply_projections_by (
const matrix_exp<EXP>& mat
);
/*!
requires
- out_vector_size() != 0
- mat.nc() == out_vector_size()
ensures
- #out_vector_size() == mat.nr()
- TODO explain what this does. introduce functions to get the
weights and basis vectors and relate it to those.
!*/
const matrix<scalar_type,0,1,mem_manager_type>& project (
const sample_type& sample
) const;
......
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