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
339ac50d
Commit
339ac50d
authored
Apr 27, 2016
by
Davis King
Browse files
Fixed double counting of mini-batches for the purposes of solver termination
when multiple GPUs are used.
parent
0f180a68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
dlib/dnn/trainer.h
dlib/dnn/trainer.h
+3
-1
No files found.
dlib/dnn/trainer.h
View file @
339ac50d
...
@@ -513,8 +513,10 @@ namespace dlib
...
@@ -513,8 +513,10 @@ namespace dlib
for
(
size_t
i
=
0
;
i
<
devices
.
size
();
++
i
)
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
);
});
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.
// aggregate loss values from all the network computations.
double
theloss
=
0
;
for
(
auto
&&
loss
:
losses
)
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
// Now, if there is more than one active device we need to synchronize the
// gradient updates between devices. So we do that now.
// gradient updates between devices. So we do that now.
...
...
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