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
f2a11f0e
Commit
f2a11f0e
authored
Jun 01, 2013
by
Davis King
Browse files
Relaxed some unnecessarily restrictive requires clauses.
parent
da40c3ba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
dlib/svm/svm_c_linear_trainer.h
dlib/svm/svm_c_linear_trainer.h
+12
-2
dlib/svm/svm_c_linear_trainer_abstract.h
dlib/svm/svm_c_linear_trainer_abstract.h
+6
-2
No files found.
dlib/svm/svm_c_linear_trainer.h
View file @
f2a11f0e
...
...
@@ -558,15 +558,25 @@ namespace dlib
)
const
{
// make sure requires clause is not broken
DLIB_ASSERT
(
is_
binary_classification
_problem
(
x
,
y
)
==
true
,
DLIB_ASSERT
(
is_
learning
_problem
(
x
,
y
)
==
true
,
"
\t
decision_function svm_c_linear_trainer::train(x,y)"
<<
"
\n\t
invalid inputs were given to this function"
<<
"
\n\t
x.nr(): "
<<
x
.
nr
()
<<
"
\n\t
y.nr(): "
<<
y
.
nr
()
<<
"
\n\t
x.nc(): "
<<
x
.
nc
()
<<
"
\n\t
y.nc(): "
<<
y
.
nc
()
<<
"
\n\t
is_
binary_classification
_problem(x,y): "
<<
is_
binary_classification
_problem
(
x
,
y
)
<<
"
\n\t
is_
learning
_problem(x,y): "
<<
is_
learning
_problem
(
x
,
y
)
);
#ifdef ENABLE_ASSERTS
for
(
long
i
=
0
;
i
<
x
.
size
();
++
i
)
{
DLIB_ASSERT
(
y
(
i
)
==
+
1
||
y
(
i
)
==
-
1
,
"
\t
decision_function svm_c_linear_trainer::train(x,y)"
<<
"
\n\t
invalid inputs were given to this function"
<<
"
\n\t
y("
<<
i
<<
"): "
<<
y
(
i
)
);
}
#endif
typedef
matrix
<
scalar_type
,
0
,
1
>
w_type
;
...
...
dlib/svm/svm_c_linear_trainer_abstract.h
View file @
f2a11f0e
...
...
@@ -256,7 +256,9 @@ namespace dlib
)
const
;
/*!
requires
- is_binary_classification_problem(x,y) == true
- is_learning_problem(x,y) == true
(Note that it is ok for x.size() == 1)
- All elements of y must be equal to +1 or -1
- x == a matrix or something convertible to a matrix via mat().
Also, x should contain sample_type objects.
- y == a matrix or something convertible to a matrix via mat().
...
...
@@ -285,7 +287,9 @@ namespace dlib
)
const
;
/*!
requires
- is_binary_classification_problem(x,y) == true
- is_learning_problem(x,y) == true
(Note that it is ok for x.size() == 1)
- All elements of y must be equal to +1 or -1
- x == a matrix or something convertible to a matrix via mat().
Also, x should contain sample_type objects.
- y == a matrix or something convertible to a matrix via mat().
...
...
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