zoukankan      html  css  js  c++  java
  • caffe自定义layer

    caffe自带layers:

    http://caffe.berkeleyvision.org/tutorial/layers.html

    Layers:

    Note that the Python Layer can be useful for create custom data layers.

    自定义caffe layers:

    https://chrischoy.github.io/research/making-caffe-layer/

    模型文件的参数在/src/caffe/proto/caffe.proto中,caffe.proto文件编译后以.h文件的方式被include/caffe/zss_layers.hpp引用,如下:

    #include "caffe/proto/caffe.pb.h"
     

    protobuf:

    https://developers.google.com/protocol-buffers/docs/cpptutorial

    syntax = "proto2";
    
    package tutorial;
    
    message Person {
      required string name = 1;
      required int32 id = 2;
      optional string email = 3;
    
      enum PhoneType {
        MOBILE = 0;
        HOME = 1;
        WORK = 2;
      }
    
      message PhoneNumber {
        required string number = 1;
        optional PhoneType type = 2 [default = HOME];
      }
    
      repeated PhoneNumber phones = 4;
    }
    
    message AddressBook {
      repeated Person people = 1;
    }

    1、2、16、3、4表示变量的编码,编码为1-15的比编码大于16的变量存储时少用1个字节的空间,因此使用频率较高的变量应当给予1-15的编码

    required——慎用

    optional——可以赋默认值

    repeated——长度不固定,可以用来存动态数组之类的

    源码阅读过程中遇到的一些c++知识:

    1、explicit关键字,禁止构造函数隐式转换

    https://blog.csdn.net/qq_35524916/article/details/58178072

    2、在类、对象之后的 . :: : ->的作用

    https://blog.csdn.net/k_koris/article/details/80469956

    3、函数后:的作用——构造函数初始化列表

    http://www.cnblogs.com/BlueTzar/articles/1223169.html

    4、c++模板

    template <class identifier> function_declaration;
    template <typename identifier> function_declaration;

    https://blog.csdn.net/qq_35637562/article/details/55194097

  • 相关阅读:
    解决CentOS6.5虚拟机克隆后无法上网(网卡信息不一致)的问题
    Linux密码保护
    破解Linux系统开机密码
    Linux常用命令
    人教版中小学教材电子版下载
    作业一
    实验四
    实验一
    实验三
    实验二
  • 原文地址:https://www.cnblogs.com/zealousness/p/9535488.html
Copyright © 2011-2022 走看看