# Caffe¶

## Abstraction¶

Caffe is one of the most famous deep learning framework for Computer Vision.

However, it seems to be stuck due to the the poor memory optimization against very deep neural nets. Besides, lacking of flexible automatic differentiation, it is awful to model multi-nets algorithms, such as GAN and Deterministic PolicyGradient.

We implement it based on the backend of Dragon thorough native Python language. Our work is very different from the official Python wrappers, a.k.a, the PyCaffe, which comes from the exports of BoostPython based on C++ language.

We demonstrate that even completely drop the Net topology proposed by Jia et al. (2014), any Graph based deep learning frameworks(Dragon, Theano, MXNet, or TensorFlow) can inherit almost specifics from Caffe also.

## Architectures¶

Layer

Layer is the basic structure for parsing text format definition. By taking the advantages of python based protobuf, we can parse and document parameters of various layers. Following the Caffe that before dismantling headers(such as 62ed0d2), we categorize these layers into six sections:

□   Data - How to prefetch data before feeding to the Net.

□   Vision - Vision relevant layers, such as Convolution and Pooling.

□   Neuron - Neuron relevant layers, most of those are activations.

□   Common - Layers using BLAS or applying on NDArray.

□   Loss - Several frequently used loss functions.

□   MPI - MPI relevant layers, for model parallelism.

For detailed Documentation, see: Layer.

Net

Net supports the most exporting interfaces used in PyCaffe. We implement it completely in the python environment, which provides much conveniences, especially when extending the modern architectures of Convolutional Neural Networks.

For detailed Documentation, see: Net.

Solver

Solver merges updates to optimize the Net. We simplified it from the original C++ implementation, that brings more unconstrained tricks for tuning hyper parameters, e.g., the learning rate.

For detailed Documentation, see: Solver.

Misc

The internal settings(e.g. GPU, Random Seed) can be configured everywhere by singleton, we contribute this to the designing of Global Context, which was also taken by Girshick (2015). In order to implement it, we bind these settings to the dragon.config.

For detailed Documentation, see: Misc.