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
b16cc99e
Commit
b16cc99e
authored
Apr 18, 2016
by
Davis King
Browse files
Added comments about using multiple GPUs
parent
ca11d108
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
examples/dnn_mnist_advanced_ex.cpp
examples/dnn_mnist_advanced_ex.cpp
+8
-1
No files found.
examples/dnn_mnist_advanced_ex.cpp
View file @
b16cc99e
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
dlib C++ Library. I'm assuming you have already read the dnn_mnist_ex.cpp
dlib C++ Library. I'm assuming you have already read the dnn_mnist_ex.cpp
example. So in this example program I'm going to go over a number of more
example. So in this example program I'm going to go over a number of more
advanced parts of the API, including:
advanced parts of the API, including:
- Using multiple GPUs
- Training on large datasets that don't fit in memory
- Training on large datasets that don't fit in memory
- Defining large networks
- Defining large networks
- Accessing and configuring layers in a network
- Accessing and configuring layers in a network
...
@@ -201,7 +202,13 @@ int main(int argc, char** argv) try
...
@@ -201,7 +202,13 @@ int main(int argc, char** argv) try
// The dnn_trainer will use SGD by default, but you can tell it to use
// The dnn_trainer will use SGD by default, but you can tell it to use
// different solvers like adam.
// different solvers like adam.
dnn_trainer
<
net_type
,
adam
>
trainer
(
net
,
adam
(
0.001
));
//dnn_trainer<net_type,adam> trainer(net,adam(0.001));
// Also, if you have multiple graphics cards you can tell the trainer to use
// them together to make the training faster. For example, replacing the
// above constructor call with this one would cause it to use GPU cards 0
// and 1.
dnn_trainer
<
net_type
,
adam
>
trainer
(
net
,
adam
(
0.001
),
{
0
,
1
});
trainer
.
be_verbose
();
trainer
.
be_verbose
();
trainer
.
set_synchronization_file
(
"mnist_resnet_sync"
,
std
::
chrono
::
seconds
(
100
));
trainer
.
set_synchronization_file
(
"mnist_resnet_sync"
,
std
::
chrono
::
seconds
(
100
));
// While the trainer is running it keeps an eye on the training error. If
// While the trainer is running it keeps an eye on the training error. If
...
...
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