"vscode:/vscode.git/clone" did not exist on "54cddc1e127a481ecb20179acf4a57f5421f4626"
Unverified Commit 5bd837d1 authored by Adrià Arrufat's avatar Adrià Arrufat Committed by GitHub
Browse files

Show number of parameters if net is allocated (#2417)

parent 4d7f88bb
...@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment