For retraining of end-to-end systems for facial expressions
Appendix 1:
Darknet Deep Learning Framework Source Code Analysis: Detailed Chinese commentary, covering framework principles and implementation syntax analysis
https://github.com/hgpvision/darknet
darknet is a relatively lightweight open source deep learning framework based entirely on C and CUDA, its main features are easy to install, no dependencies (OpenCV can be used), very portable, and supports both CPU and GPU computing methods.
Compared to TensorFlow, darknet is not that powerful, but this is also an advantage of darknet:
- darknet is completely implemented in C language, without any dependencies, of course you can use OpenCV, but only use it to display images, for better visualization;
- darknet supports CPU (so it doesn't matter if you don't have a GPU) and GPU (CUDA/cuDNN, of course it's better to use GPU);
- It is precisely because it is relatively lightweight and does not have a powerful API like TensorFlow, so I feel that it has another flavor of flexibility, which is suitable for studying the underlying and can be improved and extended from the bottom more conveniently.
- There are similarities between the implementation of darknet and the implementation of caffe, and I am familiar with darknet and believe that it is helpful to get started with caffe.
Appendix 2:
Author: Zhihu User Link:https://www.zhihu.com/question/51747665/answer/145607615 Source: Zhihu The copyright belongs to the author. For commercial reprints, please contact the author for authorization, and for non-commercial reprints, please indicate the source.
The three most important struct definitions in Darknet are network_state, network, and layer; The new version network_state has been integrated into the network.
The code can ignore the GPU part first, and different types of network layers define the execution rules of this type through the function pointers forward backward and update in the layer. For example, there are three methods for connected layers, such as forward_connected_layer backward_connected_layer update_connected_layer gru layer, etc.;
Atomic operations are only in blas.c and gemm.c, network operations are in network.c, and the most important are train_network_datum, train_networks, train_network_batch and network_predict;
train_network_datum is the float_pair used for input data, that is, float *x and float *y pairs;
train_networks is trained in network_kernel.cu in a concurrent threading mode, and the parameter is data;
One point, darknet is single-threaded in CPU mode, and in multi-GPU graphics mode, it train_networks supports multi-card running, and this is also the entrance to transform the distribution multi-host darknet operation, where you can see the trained weight data merging and scale.
train_network_datum Execute forward_network { layerwise forward network } backward_network { layerwise reverse network }, and execute a update_network ( ,,, rate, momentum, decay under the number of times (*net.seen %subdivisions) is satisfied;
For user-defined network profile processing in parse_network_cfg, the training results are read through load_weights
That's the backbone.
If you need to deal with data sources with special needs, you need to refer to data.c to get started.
For the CFG profile, the focus adjustment (of course, all parameters are important, may need to be adjusted), and the global parameter of the focus during training: decay momentum learning_rate These three are related to the convergence speed. policy is the weights policy, inputs batch (and related subdivisions) ouputs are related to the data throughput dimension, and the latest version seems to have corrections here in ouputs.
|