Caffe:Tour
Caffe is a deep learning framework and this tutorial explains its philosophy, architecture, and usage. This is a practical guide and framework introduction, so the full frontier, context, and history of deep learning cannot be covered here. While explanations will be given where possible, a background in machine learning and neural networks is helpful.
Philosophy
In one sip, Caffe is brewed for
- Expression: models and optimizations are defined as plaintext schemas instead of code.
- Speed: for research and industry alike speed is crucial for state-of-the-art models and massive data.
- Modularity: new tasks and settings require flexibility and extension.
- Openness: scientific and applied progress call for common code, reference models, and reproducibility.
- Community: academic research, startup prototypes, and industrial applications all share strength by joint discussion and development in a BSD-2 project.
and these principles direct the project.
Nets, Layers, Blobs, Model
각각 Caffe:Develop#Blob, Caffe:Develop#Layer, Caffe:Develop#Net을 참조.
Model
- Model format: The models are defined in plaintext protocol buffer schema (prototxt) while the learned models are serialized as binary protocol buffer (binaryproto) .caffemodel files.
- Prototxt를 사용하는 이유: Network description files - Why prototxt?
Forward, Backward
Caffe:Tour:ForwardBackward 참조.
Loss
주어진 가중치(Weight)들을 통하여 발생하는 오차이다. 만약 1000장의 input들에 대하여 전부 옳은 결과를 항상 출력한다면 loss는 당연히 0이다. 그리고 전부 틀린 결과를 출력한다면 loss 매우 높아진다. 보통 CNN이 학습할 수록 loss값은 줄어들게 된다.
Layer Catalogue
Solver
Interfaces
Data
This data layer definition:
layer {
name: "mnist"
# Data layer loads leveldb or lmdb storage DBs for high-throughput.
type: "Data"
# the 1st top is the data itself: the name is only convention
top: "data"
# the 2nd top is the ground truth: the name is only convention
top: "label"
# the Data layer configuration
data_param {
# path to the DB
source: "examples/mnist/mnist_train_lmdb"
# type of DB: LEVELDB or LMDB (LMDB supports concurrent reads)
backend: LMDB
# batch processing improves efficiency.
batch_size: 64
}
# common data transformations
transform_param {
# feature scaling coefficient: this maps the [0, 255] MNIST data to [0, 1]
scale: 0.00390625
}
}