Commit 9f2f6146 authored by Davis King's avatar Davis King

merged

parents dfd9543c 339ac50d
......@@ -80,7 +80,7 @@ namespace dlib
// allocate params for the filters and also for the filter bias values.
params.set_size(num_inputs*_num_filters + _num_filters);
dlib::rand rnd("con_"+cast_to_string(num_outputs+num_inputs));
dlib::rand rnd(std::rand());
randomize_parameters(params, num_inputs+num_outputs, rnd);
filters = alias_tensor(_num_filters, sub.get_output().k(), _nr, _nc);
......@@ -663,7 +663,7 @@ namespace dlib
else
params.set_size(num_inputs, num_outputs);
dlib::rand rnd("fc_"+cast_to_string(num_outputs));
dlib::rand rnd(std::rand());
randomize_parameters(params, num_inputs+num_outputs, rnd);
weights = alias_tensor(num_inputs, num_outputs);
......
......@@ -513,8 +513,10 @@ namespace dlib
for (size_t i = 0; i < devices.size(); ++i)
losses[i] = std::async(std::launch::async,[&,i](){ return compute_parameter_gradients(i, next_job, pick_which_run_update); });
// aggregate loss values from all the network computations.
double theloss = 0;
for (auto&& loss : losses)
record_loss(loss.get());
theloss += loss.get();
record_loss(theloss/losses.size());
// Now, if there is more than one active device we need to synchronize the
// gradient updates between devices. So we do that now.
......
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