zoukankan      html  css  js  c++  java
  • caffe之(二)pooling层

    在caffe中,网络的结构由prototxt文件中给出,由一些列的Layer(层)组成,常用的层如:数据加载层、卷积操作层、pooling层、非线性变换层、内积运算层、归一化层、损失计算层等;本篇主要介绍pooling层

    1. Pooling层总述

    下面首先给出pooling层的结构设置的一个小例子(定义在.prototxt文件中) 

    layer {
      name: "pool1"   //该层的名称
      type: "Pooling"  //该层的类型
      bottom: "norm1"  //该层的输入数据blob
      top: "pool1"   //该层的输出数据blob
    
      // 该层的相关参数设置
      pooling_param {
        pool: MAX  //pooling类型,默认值为MAX,也可以设置为AVE,STOCHASTIC
        kernel_size: 3  //pooling核大小,为必设参数
        stride: 2  //pooling核步长,默认值为1(即重叠),但通常设置为2;
      }
    
    }

    注:在caffe的原始proto文件中,关于卷积层的参数PoolingParameter定义如下:

    message PoolingParameter {
      enum PoolMethod {
        MAX = 0;
        AVE = 1;
        STOCHASTIC = 2;
      }
      optional PoolMethod pool = 1 [default = MAX]; // The pooling method
      // Pad, kernel size, and stride are all given as a single value for equal
      // dimensions in height and width or as Y, X pairs.
      optional uint32 pad = 4 [default = 0]; // The padding size (equal in Y, X)
      optional uint32 pad_h = 9 [default = 0]; // The padding height
      optional uint32 pad_w = 10 [default = 0]; // The padding width
      optional uint32 kernel_size = 2; // The kernel size (square)
      optional uint32 kernel_h = 5; // The kernel height
      optional uint32 kernel_w = 6; // The kernel width
      optional uint32 stride = 3 [default = 1]; // The stride (equal in Y, X)
      optional uint32 stride_h = 7; // The stride height
      optional uint32 stride_w = 8; // The stride width
      enum Engine {
        DEFAULT = 0;
        CAFFE = 1;
        CUDNN = 2;
      }
      optional Engine engine = 11 [default = DEFAULT];
      // If global_pooling then it will pool over the size of the bottom by doing
      // kernel_h = bottom->height and kernel_w = bottom->width
      optional bool global_pooling = 12 [default = false];
    }
     
  • 相关阅读:
    git push 出现 you are not allowed to upload merges 错误提示
    构建React-app应用时create-react-app卡住超慢的解决办法<转>
    防抖与节流函数<转>
    this全面解析<转>
    正确的安装和使用nvm(mac)<转>
    TypeScript如何添加自定义d.ts文件(转)
    为什么angular library的build不能将assets静态资源打包进去(转)
    Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
    linux命令新建文件
    mac系统终端sudo免输入密码技能get
  • 原文地址:https://www.cnblogs.com/lutingting/p/5240677.html
Copyright © 2011-2022 走看看