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
8055b8d1
Unverified
Commit
8055b8d1
authored
Apr 22, 2020
by
ncoder-1
Committed by
GitHub
Apr 22, 2020
Browse files
Update dnn_introduction_ex.cpp (#2066)
Changed C-style cast to static_cast.
parent
253745d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
examples/dnn_introduction_ex.cpp
examples/dnn_introduction_ex.cpp
+2
-3
No files found.
examples/dnn_introduction_ex.cpp
View file @
8055b8d1
...
@@ -138,7 +138,7 @@ int main(int argc, char** argv) try
...
@@ -138,7 +138,7 @@ int main(int argc, char** argv) try
}
}
cout
<<
"training num_right: "
<<
num_right
<<
endl
;
cout
<<
"training num_right: "
<<
num_right
<<
endl
;
cout
<<
"training num_wrong: "
<<
num_wrong
<<
endl
;
cout
<<
"training num_wrong: "
<<
num_wrong
<<
endl
;
cout
<<
"training accuracy: "
<<
num_right
/
(
double
)
(
num_right
+
num_wrong
)
<<
endl
;
cout
<<
"training accuracy: "
<<
num_right
/
static_cast
<
double
>
(
num_right
+
num_wrong
)
<<
endl
;
// Let's also see if the network can correctly classify the testing images. Since
// Let's also see if the network can correctly classify the testing images. Since
// MNIST is an easy dataset, we should see at least 99% accuracy.
// MNIST is an easy dataset, we should see at least 99% accuracy.
...
@@ -155,7 +155,7 @@ int main(int argc, char** argv) try
...
@@ -155,7 +155,7 @@ int main(int argc, char** argv) try
}
}
cout
<<
"testing num_right: "
<<
num_right
<<
endl
;
cout
<<
"testing num_right: "
<<
num_right
<<
endl
;
cout
<<
"testing num_wrong: "
<<
num_wrong
<<
endl
;
cout
<<
"testing num_wrong: "
<<
num_wrong
<<
endl
;
cout
<<
"testing accuracy: "
<<
num_right
/
(
double
)
(
num_right
+
num_wrong
)
<<
endl
;
cout
<<
"testing accuracy: "
<<
num_right
/
static_cast
<
double
>
(
num_right
+
num_wrong
)
<<
endl
;
// Finally, you can also save network parameters to XML files if you want to do
// Finally, you can also save network parameters to XML files if you want to do
...
@@ -167,4 +167,3 @@ catch(std::exception& e)
...
@@ -167,4 +167,3 @@ catch(std::exception& e)
{
{
cout
<<
e
.
what
()
<<
endl
;
cout
<<
e
.
what
()
<<
endl
;
}
}
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