mirror of https://github.com/davisking/dlib.git
Fixed a bug in the sparse decision functions. The input validation rejected
most vectors
This commit is contained in:
parent
1513c94fb9
commit
4ef91280e4
|
@ -20,11 +20,12 @@ double predict (
|
|||
const typename decision_function::kernel_type::sample_type& samp
|
||||
)
|
||||
{
|
||||
typedef typename decision_function::kernel_type::sample_type T;
|
||||
if (df.basis_vectors.size() == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (df.basis_vectors(0).size() != samp.size())
|
||||
else if (is_matrix<T>::value && df.basis_vectors(0).size() != samp.size())
|
||||
{
|
||||
std::ostringstream sout;
|
||||
sout << "Input vector should have " << df.basis_vectors(0).size()
|
||||
|
|
Loading…
Reference in New Issue