Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
700ea34e
Commit
700ea34e
authored
Oct 30, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the is_sequence_labeling_problem() routine.
parent
5ad3106c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
svm.h
dlib/svm/svm.h
+23
-0
svm_abstract.h
dlib/svm/svm_abstract.h
+17
-0
No files found.
dlib/svm/svm.h
View file @
700ea34e
...
...
@@ -175,6 +175,29 @@ namespace dlib
vector_to_matrix
(
y_test
));
}
// ----------------------------------------------------------------------------------------
template
<
typename
sample_type
>
bool
is_sequence_labeling_problem
(
const
std
::
vector
<
std
::
vector
<
sample_type
>
>&
samples
,
const
std
::
vector
<
std
::
vector
<
unsigned
long
>
>&
labels
)
{
if
(
is_learning_problem
(
samples
,
labels
))
{
for
(
unsigned
long
i
=
0
;
i
<
samples
.
size
();
++
i
)
{
if
(
samples
[
i
].
size
()
!=
labels
[
i
].
size
())
return
false
;
}
return
true
;
}
return
false
;
}
// ----------------------------------------------------------------------------------------
template
<
...
...
dlib/svm/svm_abstract.h
View file @
700ea34e
...
...
@@ -62,6 +62,23 @@ namespace dlib
- x_labels(i) == -1 or +1
!*/
template
<
typename
sample_type
>
bool
is_sequence_labeling_problem
(
const
std
::
vector
<
std
::
vector
<
sample_type
>
>&
samples
,
const
std
::
vector
<
std
::
vector
<
unsigned
long
>
>&
labels
);
/*!
ensures
- returns true if all of the following are true and false otherwise:
- is_learning_problem(samples, labels) == true
- for all valid i:
- samples[i].size() == labels[i].size()
(i.e. The size of a label sequence need to match the size of
its corresponding sample sequence)
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
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