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
6989e96f
Commit
6989e96f
authored
May 18, 2013
by
Davis King
Browse files
Added per label bias features.
parent
e2ea6cfa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
dlib/svm/sequence_segmenter.h
dlib/svm/sequence_segmenter.h
+9
-4
dlib/svm/sequence_segmenter_abstract.h
dlib/svm/sequence_segmenter_abstract.h
+3
-3
No files found.
dlib/svm/sequence_segmenter.h
View file @
6989e96f
...
...
@@ -74,9 +74,9 @@ namespace dlib
{
const
unsigned
long
NL
=
ss_feature_extractor
::
use_BIO_model
?
3
:
5
;
if
(
ss_feature_extractor
::
use_high_order_features
)
return
NL
*
NL
+
(
NL
*
NL
+
NL
)
*
fe
.
num_features
()
*
fe
.
window_size
();
return
NL
+
NL
*
NL
+
(
NL
*
NL
+
NL
)
*
fe
.
num_features
()
*
fe
.
window_size
();
else
return
NL
*
NL
+
NL
*
fe
.
num_features
()
*
fe
.
window_size
();
return
NL
+
NL
*
NL
+
NL
*
fe
.
num_features
()
*
fe
.
window_size
();
}
unsigned
long
order
()
const
...
...
@@ -229,6 +229,11 @@ namespace dlib
// previous label and the current label.
if
(
y
.
size
()
>
1
)
set_feature
(
offset
+
y
(
1
)
*
num_labels
()
+
y
(
0
));
offset
+=
num_labels
()
*
num_labels
();
// pull out an indicator feature for the current label. This is the per
// label bias.
set_feature
(
offset
+
y
(
0
));
}
};
...
...
@@ -245,9 +250,9 @@ namespace dlib
{
const
unsigned
long
NL
=
feature_extractor
::
use_BIO_model
?
3
:
5
;
if
(
feature_extractor
::
use_high_order_features
)
return
NL
*
NL
+
(
NL
*
NL
+
NL
)
*
fe
.
num_features
()
*
fe
.
window_size
();
return
NL
+
NL
*
NL
+
(
NL
*
NL
+
NL
)
*
fe
.
num_features
()
*
fe
.
window_size
();
else
return
NL
*
NL
+
NL
*
fe
.
num_features
()
*
fe
.
window_size
();
return
NL
+
NL
*
NL
+
NL
*
fe
.
num_features
()
*
fe
.
window_size
();
}
// ----------------------------------------------------------------------------------------
...
...
dlib/svm/sequence_segmenter_abstract.h
View file @
6989e96f
...
...
@@ -163,9 +163,9 @@ namespace dlib
the various label combination instead of 12*3.
Finally, while not shown here, we also include indicator features in
XI() to model label transitions
. These are 9 extra features in th
e
case of the BIO tagging model and
25
extra in
the case of the BILOU
tagging model.
XI() to model label transitions
and individual label biases. These ar
e
12 extra features in the
case of the BIO tagging model and
30
extra in
the case of the BILOU
tagging model.
THREAD SAFETY
Instances of this object are required to be threadsafe, that is, it should
...
...
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