directory Structure
Main files under Caffe folder:
dataTraining data for storing downloads
docsHelp documentation
exampleSome sample code
matlabMatlab interface file
pythonPython interface file
modelSome well-configured model parameters
scriptsScripts for some documents and data
The following is the core code folder:
toolsThe saved source code is used to generate binary handlers, and Caffe actually calls these binaries directly during training.
includeCaffe the implementation code of the header file
srcImplementing the Caffe Source file
The following study focuses on the following two file directories ( include and src ) under Code expansion
Source Structure
src
gtestGoogle test a library for testing you see a lot of green run OK runtest when you make it, this is nothing to do with Caffe's learning, but a useful library
caffeThis is where the key code is.
testTest the code for Caffe with Gtest
utilSome code to use when converting data. Caffe is fast, thanks in large part to memory design optimizations (BLOB data structures with proto) and convolution optimizations (partly related to Im2col) [1].
protoThe so-called "Protobuf" [2], full name "Google Protocol Buffer", is a data storage format to help Caffe speed up.
layersThe basic structure of the deep neural network is a layer of different networks, the source files under this folder and all the. cpp files that are contained in the current location "Src/caffe" are the core code in the core directory of Caffe.
Main Source Relationship
As we can now know, the core of the Caffe core is the following documents and files: (this part of the current unclear place to refer to other people's views first)
- Blob[.cpp. h] Basic data Structure BLOB class [3].
- Common[.cpp. h] Define Caffe class
- Internal_thread[.cpp. h] Use Boost::thread line libraries
- Net[.cpp. h] Network structure class net
- Solver[.cpp. h] Optimization method class Solver
- Data_transformer[.cpp. h] Basic operation class for input data Datatransformer
- Syncedmem[.cpp. h] allocating memory and freeing memory class Caffemallochost for synchronizing GPU,CPU data
- Layer_factory.cpp Layer.h Layer Class
layersThe code below this folder inherits at least the class layer
The Include folder contains the HPP files. Hppits essence is to. cppimplementation code is mixed. hheader file, where the definition and implementation are contained in the same file, the caller of the class only needs toincludetheCPPfiles, no moreCPPadded toProjectto compile in the. The implementation code is compiled directly to the caller'sobjfile, no longer generates a separateobj,AdoptHPPwill drastically reduce the callProjectin theCPPnumber of files and number of compilations, and no need to post annoyingLibwith theDLL,This makes it ideal for writing common open-source libraries. Each. cpp file in src corresponds to the header file in the include file.
Caffe the directory structure of this C + + project