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
5bd837d1
Unverified
Commit
5bd837d1
authored
Aug 19, 2021
by
Adrià Arrufat
Committed by
GitHub
Aug 19, 2021
Browse files
Show number of parameters if net is allocated (#2417)
parent
4d7f88bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
dlib/dnn/trainer.h
dlib/dnn/trainer.h
+5
-1
No files found.
dlib/dnn/trainer.h
View file @
5bd837d1
...
@@ -1363,7 +1363,11 @@ namespace dlib
...
@@ -1363,7 +1363,11 @@ namespace dlib
net_type
temp
=
trainer
.
get_net
();
// make a copy so that we can clean it without mutating the trainer's net.
net_type
temp
=
trainer
.
get_net
();
// make a copy so that we can clean it without mutating the trainer's net.
temp
.
clean
();
temp
.
clean
();
serialize
(
temp
,
sout
);
serialize
(
temp
,
sout
);
out
<<
" net size: "
<<
sout
.
str
().
size
()
/
1024.0
/
1024.0
<<
" MiB"
<<
endl
;
out
<<
" net size: "
<<
sout
.
str
().
size
()
/
1024.0
/
1024.0
<<
" MiB"
;
const
auto
num_params
=
count_parameters
(
temp
);
if
(
num_params
>
0
)
out
<<
" ("
<<
num_params
<<
" parameters)"
;
out
<<
endl
;
// Don't include the loss params in the hash since we print them on the next line.
// Don't include the loss params in the hash since we print them on the next line.
// They also aren't really part of the "architecture" of the network.
// They also aren't really part of the "architecture" of the network.
out
<<
" net architecture hash: "
<<
md5
(
cast_to_string
(
trainer
.
get_net
().
subnet
()))
<<
endl
;
out
<<
" net architecture hash: "
<<
md5
(
cast_to_string
(
trainer
.
get_net
().
subnet
()))
<<
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