Commit Graph

5928 Commits

Author SHA1 Message Date
Fm
93e786db6c Merge branch 'master' of https://github.com/davisking/dlib into dnn_group_layer 2016-05-26 17:15:56 +03:00
Davis King
911638638d Made add_prev output a tensor with dimensions that are the max of each of the
dimensions of its inputs rather than always outputting a tensor that has the
dimensions of its immediate predecessors.
2016-05-25 19:12:36 -04:00
Davis King
b9332698fe updated example 2016-05-23 22:01:47 -04:00
Davis King
e5ad959085 Added bias learning rate and weight decay multipliers to bn_ layers 2016-05-23 22:01:37 -04:00
Davis King
b6b8379819 Relaxed the requirements for calling find_min_box_constrained() and
find_max_box_constrained().  Now the bounds can be empty for some variables.
2016-05-23 20:25:43 -04:00
Davis King
974743767f Changed code to avoid recreating thread_local cuda context objects. 2016-05-23 19:57:53 -04:00
Davis King
e55afabd1a fixed broken tests 2016-05-23 06:54:55 -04:00
Davis King
1cbf940eb3 Fixed a bug I introduced a minute ago. 2016-05-22 16:30:09 -04:00
Davis King
f189612876 Fixed a bug in visit_layer_parameter_gradients() and visit_layer_parameters()
caused by num_computational_layers being wrong when tax layers were placed as
the first layer.  These visit functions being wrong also caused multi-GPU
support to not work on such networks.
2016-05-22 16:14:10 -04:00
Davis King
d019e9cd08 Changed the trainer threading code to use dlib::thread_pool instead of
std::async() since std::async creates new threads with each invocation, which
in turn causes objects with thread_local storage duration to be reconstructed
each time.  This is problematic because CUDA context objects for cublas and
cudnn get reconstructed over and over, slowing things down and generally using
more resources than should be used.
2016-05-22 15:49:40 -04:00
Davis King
5e70b7a2c6 Cleaned up code a little and made the example use a better version of the architecture. 2016-05-22 13:17:10 -04:00
Davis King
b73dacc163 Fixing tests 2016-05-22 10:30:15 -04:00
Davis King
7f77ec6559 Made the batch normalization epsilon user settable rather than being hard coded. 2016-05-22 10:26:23 -04:00
Davis King
b92b226c6a Added learning rate and weight decay multipliers to the con_, fc_, and bn_
layers.  Updated the solvers to support this.
2016-05-22 09:59:34 -04:00
Davis King
40f04bebae Added more tests for the new affine_transform_range() 2016-05-21 23:23:06 -04:00
Davis King
c3a74c7c1c Added affine_transform_range() and another overload of affine_transform() 2016-05-21 23:22:26 -04:00
Davis King
15b2d7b5d8 Added get_learning_rate_multiplier() and get_weight_decay_multiplier() global
functions.
2016-05-21 23:16:49 -04:00
Davis King
58496f9f8a Added Johannes Huber's natvis file for visual studio. 2016-05-20 08:29:39 -04:00
Davis King
0cd76f899b Added an error message if a camera isn't available. 2016-05-18 22:22:56 -04:00
Fm
598924098a depth layer: cuda concat/split moved to cpu/cuda files 2016-05-17 13:36:48 +03:00
Fm
28c4a48281 Grouping layer added 2016-05-17 13:07:04 +03:00
Davis King
617ffba652 Made LIB_INSTALL_DIR only appear when building dlib as an installable library, not when using dlib in another cmake project. 2016-05-15 19:56:55 -04:00
Davis King
b0cf7dc0f9 Now when you print a network to cout it will include the output tensor sizes
for each layer if you have passed a tensor through the next.
2016-05-15 16:28:44 -04:00
Davis King
2092e3030b Renamed compute_loss() to compute_loss_value_and_gradient() in the loss
interface.
2016-05-15 15:07:04 -04:00
Davis King
ee2a0070db Added comment to show how to deserialize a network. 2016-05-15 14:52:33 -04:00
Davis King
ba0f7c5c53 Added a function to dnn_trainer that lets you query the "steps without
progress" estimate.  I also renamed the get/set functions for the shrink amount
to have a consistent name and use the word "factor" instead of "amount".
2016-05-15 14:48:06 -04:00
Davis King
b974a57513 Added set_learning_rate_schedule() to dnn_trainer. 2016-05-15 14:36:02 -04:00
Davis King
13cc545da3 clarified comments. 2016-05-15 14:31:06 -04:00
Davis King
93bbe5ff15 merged 2016-05-14 20:31:50 -04:00
Davis King
66166c674d Changed the solver interface to take the learning rate and the layer details
object as an input.  This allows the solvers to exhibit a more complex behavior
that depends on the specific layer.  It also removes the learning rate from the
solver's parameter set and pushes it entirely into the core training code.
This also removes the need for the separate "step size" which previously was
multiplied with the output of the solvers.

Most of the code is still the same, and in the core and trainer the step_size
variables have just been renamed to learning_rate.  The dnn_trainer's relevant
member functions have also been renamed.

The examples have been updated to reflect these API changes.  I also cleaned up
the resnet definition and added better downsampling.
2016-05-14 20:30:45 -04:00
Davis King
9763c471ac merged 2016-05-13 23:08:47 -04:00
Davis King
8421f213ad Fixed the in-place layers so that they don't interfere with the operation of
skip layers and add_prev style layers.  In particular, now in-place layers only
overwrite the gradient information in their child layer if they are operating
in in-place mode.  Otherwise, they add their gradients to their child layers.

It should also be noted that it's safe for in-place layers to overwrite
gradients when in in-place mode since their child layers are inaccessible when
in-place layers operate in in-place mode.  This prevents any other layers from
trying to add to the child layer, thereby avoiding the potability of layer
interference.  So the bug this change fixes is that, when not in in-place mode
the child layers are still accessible but in-place layers were *still*
overwriting child gradients.
2016-05-13 23:08:03 -04:00
Davis King
ead735d0b0 Made printing to cout or cerr check for matlab ctrl+c and throw an exception
if so.  This way, if you have a long running mex file it will be killable if
it is periodically printing.
2016-05-13 09:01:24 -04:00
Davis King
81eb18a40f Added intel architecture detection so SSE/AVX isn't enabled when it shouldn't be. 2016-05-13 08:50:25 -04:00
Davis King
3124ec4b81 Made dropout layer initialize its random number generator from std::rand() rather than always
using the same seed.
2016-05-13 08:35:22 -04:00
Davis King
da28fe3b3e Fixed a compiler error on some systems. 2016-05-13 06:40:15 -04:00
Davis King
c79d412c32 slightly relaxed tests to avoid false failure 2016-05-13 06:32:18 -04:00
Davis King
022dce43c2 I accidentally turned the max pooling layers into average pooling a few days
ago.  This fixes that and turns them back into max pooling layers.
2016-05-12 19:40:24 -04:00
Davis King
6f970e1854 Fixed network constructors so you can give an input layer for initialization
without getting a compiler error.
2016-05-12 19:22:53 -04:00
Davis E. King
0846daabdc Merge pull request #108 from SoapGentoo/master
Augment build-system, allow for multilib installation, support pkg-config discovery
2016-05-10 06:37:44 -04:00
David Seifert
f3eae43897
* Add pkg-config file, allowing for build-system agnostic dependencies
* Define LIB_INSTALL_DIR cache variable, allowing for multilib installations
* Discover BLAS and LAPACK via pkg-config if possible
* Fix incorrect toolchain variables in "dlib/test/makefile"
2016-05-10 09:18:27 +02:00
Davis King
cad73fae9d Fixed compiler warnings 2016-05-09 21:46:04 -04:00
Davis King
1e70c721a4 Made example use the "everything" version of avg pooling. 2016-05-07 14:30:42 -04:00
Davis King
f669552186 Added max_pool_everything and avg_pool_everything. 2016-05-07 14:30:18 -04:00
Davis King
6d2495a20a Changed extract_fhog_features() back to returning matrix<double> since that's
what it's contract says needs to happen (and what existing code expects).
2016-05-07 07:53:27 -04:00
Davis King
51065b9808 Made test error reporting more reliable 2016-05-05 06:58:52 -04:00
Davis King
4a7633056c Fixed avg pooling filter sizes to avoid errors with the new rules about
non-one based strides.
2016-05-04 21:40:29 -04:00
Davis King
e4d70f8d3d Improved error messages 2016-05-04 21:39:31 -04:00
Davis King
4ef5908b0a Pushed the padding parameters into the con_, max_pool_, and avg_pool_
interfaces.  Also changed the default behavior when the stride isn't 1.  Now
the filters will be applied only to the "valid" part of the image.
2016-05-04 21:32:59 -04:00
Davis King
6bab1f50ad Added missing ; to DLIB_TEST and DLIB_TEST_MSG macros now that they are required. 2016-05-04 21:27:10 -04:00