Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
4ef91280
Commit
4ef91280
authored
Jun 08, 2013
by
Davis King
Browse files
Fixed a bug in the sparse decision functions. The input validation rejected
most vectors
parent
1513c94f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
tools/python/src/decision_functions.cpp
tools/python/src/decision_functions.cpp
+2
-1
No files found.
tools/python/src/decision_functions.cpp
View file @
4ef91280
...
@@ -20,11 +20,12 @@ double predict (
...
@@ -20,11 +20,12 @@ double predict (
const
typename
decision_function
::
kernel_type
::
sample_type
&
samp
const
typename
decision_function
::
kernel_type
::
sample_type
&
samp
)
)
{
{
typedef
typename
decision_function
::
kernel_type
::
sample_type
T
;
if
(
df
.
basis_vectors
.
size
()
==
0
)
if
(
df
.
basis_vectors
.
size
()
==
0
)
{
{
return
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
;
std
::
ostringstream
sout
;
sout
<<
"Input vector should have "
<<
df
.
basis_vectors
(
0
).
size
()
sout
<<
"Input vector should have "
<<
df
.
basis_vectors
(
0
).
size
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment