directory Structure
Main files under Caffe folder:
data
Training data for storing downloads
docs
Help documentation
example
Some sample code
matlab
Matlab interface file
python
Python interface file
model
Some well-configured model parameters
scripts
Scripts for some documents and data
The following is the core code folder:
tools
The saved source code is used to generate binary handlers, and Caffe actually calls these binaries directly during training.
include
Caffe the implementation code of the header file
src
Implementing the Caffe Source file
The following study focuses on the following two file directories ( include
and src
) under Code expansion
Source Structure
src
gtest
Google 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
caffe
This is where the key code is.
test
Test the code for Caffe with Gtest
util
Some 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].
proto
The so-called "Protobuf" [2], full name "Google Protocol Buffer", is a data storage format to help Caffe speed up.
layers
The 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
layers
The 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