Caffe小记

Caffe中的文件结构:

  • deploy.prototxt
  • solver.prototxt
  • train_val.prototxt
  • train.caffemodel
  1. deploy.prototxt文件中Layer的定义形式

 layer {
             name: "data/*"
             type: "Input/Convolution/ReLU/Pooling/LRN/InnerProduct/Dropout/Softmax"
              bottom: “data/conv/pool/norm/*"
              top: "data/conv/pool/norm/*"
              input/convolution/pooling/lrn/inner_produce/*/_param{
                        *具体的各种参数定义*
                 }
       }

    2.Caffe官方文档中的一些内容

 1.”the blob is the standard array and unified memory interface for the framework“ 
-- "Blob 是标准的数组以及对于框架而言统一存储接口"
 2.”Mathematically, a blob is an N-dimensional array stored in a C-contiguous fashion.“
-- “从数学的角度来讲,一个Blob就是一个N维数组以C-连续格式进行存储”
 3."Each layer type defines three critical computations:setup,forward and backward."
-- “每一个Layer层定义了三种重要的计算:初始,前线传播,反向传播”  

 4."A typical net begins with a data layer that loads from disk and ends with a loss layer that computes the objective for a task such as classification or reconstruction."
-- “一个典型的网络都会以硬盘上读取数据的Data层作为开始,以计算例如分类或者重建为目标任务的Loss层作为结束,”
 5.“To create a Caffe model you need to define the model architecture in a protocol buffer definition file ”
-- “创建一个Caffe模型,需要在协议缓冲区定义文件中定义一个模型架构”
 --    Caffe原文
:setup,forward and backward."
-- “每一个Layer层定义了三种重要的计算:初始,前线传播,反向传播”  

 4."A typical net begins with a data layer that loads from disk and ends with a loss layer that computes the objective for a task such as classification or reconstruction."
-- “一个典型的网络都会以硬盘上读取数据的Data层作为开始,以计算例如分类或者重建为目标任务的Loss层作为结束,”
 5.“To create a Caffe model you need to define the model architecture in a protocol buffer definition file ”
-- “创建一个Caffe模型,需要在协议缓冲区定义文件中定义一个模型架构”
 --    Caffe原文

 

Caffe中的Layers

1.Data Layers

  • Image Data - read raw images.
  • Database - read data from LEVELDB or LMDB.
  • HDF5 Input - read HDF5 data, allows data of arbitrary dimensions.
  • HDF5 Output - write data as HDF5.
  • Input - typically used for networks that are being deployed.
  • Window Data - read window data file.
  • Memory Data - read data directly from memory.
  • Dummy Data - for static data and debugging.

2.Vision Layers

  • Convolution Layer - convolves the input image with a set of learnable filters, each producing one feature map in the output image.
  • Pooling Layer - max, average, or stochastic pooling.
  • Spatial Pyramid Pooling (SPP)
  • Crop - perform cropping transformation.
  • Deconvolution Layer - transposed convolution.

  • Im2Col - relic helper layer that is not used much anymore.

3.Loss

  • learning is driven by a loss function (also known as an error, cost, or objective function).
  • Hence, the goal of learning is to find a setting of the weights that minimizes the loss function.

 

Caffe网络结构可视化

  • 在线网页绘制网络结构图

        http://ethereon.github.io/netscope/#/editor

  • Caffe命令绘制网络结构图

$ cd ${CAFFE_ROOT}
$ python ./python/draw_net.py ./models/bvlc_reference_caffenet/train_val.prototxt netImage/CaffeNet.png

 

 

 

你可能感兴趣的:(Caffe)