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
3b518f40
Unverified
Commit
3b518f40
authored
Mar 23, 2022
by
Adrià Arrufat
Committed by
GitHub
Mar 23, 2022
Browse files
Fix deserialize logic in loss_multibinary_log (#2547)
parent
1b7053fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
dlib/dnn/loss.h
dlib/dnn/loss.h
+12
-3
No files found.
dlib/dnn/loss.h
View file @
3b518f40
...
@@ -877,11 +877,20 @@ namespace dlib
...
@@ -877,11 +877,20 @@ namespace dlib
{
{
std
::
string
version
;
std
::
string
version
;
deserialize
(
version
,
in
);
deserialize
(
version
,
in
);
if
(
version
!=
"loss_multibinary_log_"
||
version
!=
"loss_multibinary_log_2"
)
if
(
version
==
"loss_multibinary_log_"
)
throw
serialization_error
(
"Unexpected version found while deserializing dlib::loss_multibinary_log_."
);
{
if
(
version
==
"loss_multibinary_log_2"
)
item
.
gamma
=
0
;
return
;
}
else
if
(
version
==
"loss_multibinary_log_2"
)
{
deserialize
(
item
.
gamma
,
in
);
deserialize
(
item
.
gamma
,
in
);
}
}
else
{
throw
serialization_error
(
"Unexpected version found while deserializing dlib::loss_multibinary_log_."
);
}
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
loss_multibinary_log_
&
item
)
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
loss_multibinary_log_
&
item
)
{
{
...
...
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