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
cc118abc
Commit
cc118abc
authored
Oct 30, 2011
by
Davis King
Browse files
setup serialization for the sequence_labeler.
parent
0ba771b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
1 deletion
+62
-1
dlib/svm/sequence_labeler.h
dlib/svm/sequence_labeler.h
+36
-1
dlib/svm/sequence_labeler_abstract.h
dlib/svm/sequence_labeler_abstract.h
+26
-0
No files found.
dlib/svm/sequence_labeler.h
View file @
cc118abc
...
...
@@ -57,7 +57,9 @@ namespace dlib
// ----------------------------------------------------------------------------------------
template
<
typename
feature_extractor
>
template
<
typename
feature_extractor
>
class
sequence_labeler
{
public:
...
...
@@ -152,6 +154,39 @@ namespace dlib
matrix
<
double
,
0
,
1
>
weights
;
};
// ----------------------------------------------------------------------------------------
template
<
typename
feature_extractor
>
void
serialize
(
const
sequence_labeler
<
feature_extractor
>&
item
,
std
::
ostream
&
out
)
{
serialize
(
item
.
get_feature_extractor
(),
out
);
serialize
(
item
.
get_weights
(),
out
);
}
// ----------------------------------------------------------------------------------------
template
<
typename
feature_extractor
>
void
deserialize
(
sequence_labeler
<
feature_extractor
>&
item
,
std
::
istream
&
in
)
{
feature_extractor
fe
;
matrix
<
double
,
0
,
1
>
weights
;
deserialize
(
fe
,
in
);
deserialize
(
weights
,
in
);
item
=
sequence_labeler
<
feature_extractor
>
(
fe
,
weights
);
}
// ----------------------------------------------------------------------------------------
}
...
...
dlib/svm/sequence_labeler_abstract.h
View file @
cc118abc
...
...
@@ -54,6 +54,32 @@ namespace dlib
};
// ----------------------------------------------------------------------------------------
template
<
typename
feature_extractor
>
void
serialize
(
const
sequence_labeler
<
feature_extractor
>&
item
,
std
::
ostream
&
out
);
/*!
provides serialization support
!*/
// ----------------------------------------------------------------------------------------
template
<
typename
feature_extractor
>
void
deserialize
(
sequence_labeler
<
feature_extractor
>&
item
,
std
::
istream
&
in
);
/*!
provides deserialization support
!*/
// ----------------------------------------------------------------------------------------
}
...
...
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