caffe中activation function的形式,直接决定了其训练速度以及SGD的求解。

在caffe中,不同的activation function对应的sgd的方式是不同的,因此,在配置文件中指定activation layer的type,目前caffe中用的最多的是relu的activation function.

caffe中,目前实现的activation function有以下几种:

absval, bnll, power, relu, sigmoid, tanh等几种,分别有单独的layer层。其数学公式分别为:

算了,这部分我不解释了,直接看caffe的tutorial

ReLU / Rectified-Linear and Leaky-ReLU

  • LayerType: RELU
  • CPU implementation: ./src/caffe/layers/relu_layer.cpp
  • CUDA GPU implementation: ./src/caffe/layers/relu_layer.cu
  • Parameters (ReLUParameter relu_param)
    • Optional

      • negative_slope [default 0]: specifies whether to leak the negative part by multiplying it with the slope value rather than setting it to 0.
  • Sample (as seen in ./examples/imagenet/imagenet_train_val.prototxt)

    layers {
    name: "relu1"
    type: RELU
    bottom: "conv1"
    top: "conv1"
    }

Given an input value x, The RELU layer computes the output as x if x > 0 and negative_slope * x if x <= 0. When the negative slope parameter is not set, it is equivalent to the standard ReLU function of taking max(x, 0). It also supports in-place computation, meaning that the bottom and the top blob could be the same to preserve memory consumption.

Sigmoid

  • LayerType: SIGMOID
  • CPU implementation: ./src/caffe/layers/sigmoid_layer.cpp
  • CUDA GPU implementation: ./src/caffe/layers/sigmoid_layer.cu
  • Sample (as seen in ./examples/imagenet/mnist_autoencoder.prototxt)

    layers {
    name: "encode1neuron"
    bottom: "encode1"
    top: "encode1neuron"
    type: SIGMOID
    }

The SIGMOID layer computes the output as sigmoid(x) for each input element x.

TanH / Hyperbolic Tangent

  • LayerType: TANH
  • CPU implementation: ./src/caffe/layers/tanh_layer.cpp
  • CUDA GPU implementation: ./src/caffe/layers/tanh_layer.cu
  • Sample

    layers {
    name: "layer"
    bottom: "in"
    top: "out"
    type: TANH
    }

The TANH layer computes the output as tanh(x) for each input element x.

Absolute Value

  • LayerType: ABSVAL
  • CPU implementation: ./src/caffe/layers/absval_layer.cpp
  • CUDA GPU implementation: ./src/caffe/layers/absval_layer.cu
  • Sample

    layers {
    name: "layer"
    bottom: "in"
    top: "out"
    type: ABSVAL
    }

The ABSVAL layer computes the output as abs(x) for each input element x.

Power

  • LayerType: POWER
  • CPU implementation: ./src/caffe/layers/power_layer.cpp
  • CUDA GPU implementation: ./src/caffe/layers/power_layer.cu
  • Parameters (PowerParameter power_param)
    • Optional

      • power [default 1]
      • scale [default 1]
      • shift [default 0]
  • Sample

    layers {
    name: "layer"
    bottom: "in"
    top: "out"
    type: POWER
    power_param {
    power: 1
    scale: 1
    shift: 0
    }
    }

The POWER layer computes the output as (shift + scale * x) ^ power for each input element x.

BNLL

  • LayerType: BNLL
  • CPU implementation: ./src/caffe/layers/bnll_layer.cpp
  • CUDA GPU implementation: ./src/caffe/layers/bnll_layer.cu
  • Sample

    layers {
    name: "layer"
    bottom: "in"
    top: "out"
    type: BNLL
    }

The BNLL (binomial normal log likelihood) layer computes the output as log(1 + exp(x)) for each input element x.

caffe中的sgd,与激活函数(activation function)的更多相关文章

  1. 激活函数-Activation Function

    该博客的内容是莫烦大神的授课内容.在此只做学习记录作用. 原文连接:https://morvanzhou.github.io/tutorials/machine-learning/tensorflow ...

  2. 浅谈深度学习中的激活函数 - The Activation Function in Deep Learning

    原文地址:http://www.cnblogs.com/rgvb178/p/6055213.html版权声明:本文为博主原创文章,未经博主允许不得转载. 激活函数的作用 首先,激活函数不是真的要去激活 ...

  3. The Activation Function in Deep Learning 浅谈深度学习中的激活函数

    原文地址:http://www.cnblogs.com/rgvb178/p/6055213.html 版权声明:本文为博主原创文章,未经博主允许不得转载. 激活函数的作用 首先,激活函数不是真的要去激 ...

  4. 《Noisy Activation Function》噪声激活函数(一)

    本系列文章由 @yhl_leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/51736830 Noisy Activa ...

  5. MXNet 定义新激活函数(Custom new activation function)

    https://blog.csdn.net/weixin_34260991/article/details/87106463 这里使用比较简单的定义方式,只是在原有的激活函数调用中加入. 准备工作下载 ...

  6. 激活函数:Swish: a Self-Gated Activation Function

    今天看到google brain 关于激活函数在2017年提出了一个新的Swish 激活函数. 叫swish,地址:https://arxiv.org/abs/1710.05941v1 pytorch ...

  7. TensorFlow Activation Function 1

    部分转自:https://blog.csdn.net/caicaiatnbu/article/details/72745156 激活函数(Activation Function)运行时激活神经网络中某 ...

  8. caffe中各层的作用:

    关于caffe中的solver: cafffe中的sover的方法都有: Stochastic Gradient Descent (type: "SGD"), AdaDelta ( ...

  9. ML 激励函数 Activation Function (整理)

    本文为内容整理,原文请看url链接,感谢几位博主知识来源 一.什么是激励函数 激励函数一般用于神经网络的层与层之间,上一层的输出通过激励函数的转换之后输入到下一层中.神经网络模型是非线性的,如果没有使 ...

随机推荐

  1. VBS 学习

    VBS其他功能 获取系统用户名 DimWshNetwork Set WshNetwork =CreateObject("WScript.Network") strTaccount ...

  2. AUTO Uninstaller 下载 (maya/3dsmax/cad/Inventor/Revit uninstall tool 卸载修复工具)

    小伙伴是不是遇到 MAYA/CAD/3DSMAX/INVENTOR/REVIT 安装失败或者安装不了的问题了呢?AUTODESK系列软件着实令人头疼,MAYA/CAD/3DSMAX/INVENTOR/ ...

  3. 手机缺失sqlite3时操作数据库的多种解决方案 ----adb命令科普

    在Android应用开发无处不在SQLite数据库的身影.那么在开发中怎么使用adb命令操作数据库的功能呢? 下面我们将完整的介绍与数据库操作相关的命令集及当手机缺少sqlite3的时候的多种解决方案 ...

  4. LeetCode 122.买卖股票的最佳时机(C++)

    给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格. 设计一个算法来计算你所能获取的最大利润.你可以尽可能地完成更多的交易(多次买卖一支股票). 注意:你不能同时参与多笔交易(你必须在再次 ...

  5. REST面向资源架构 RESTful架构

    REST基础概念: 在REST中的一切都被认为是一种资源. 每个资源由URI标识. 使用统一的接口.处理资源使用POST,GET,PUT,DELETE操作类似创建,读取,更新和删除(CRUD)操作. ...

  6. jq获取页面距离

    $(window).height() //获取的是当前可视窗口的高度,也就是用户能看到的窗口的高度,是不变的(在窗口大小不变的前提下) $(document).height() //获取的是窗口内文档 ...

  7. GDI+图形图像处理技术——GDIPlus绘图基础

    GDI+概述 GDI在windows中定义为Graphis Device interface,及图形设备接口,是Windows API(application Programming Interfac ...

  8. 【杜鹃沙盒】Cuckoo SandBox学习笔记

    这是个github上开源前十的项目之一,笔者只完成学习了部分功能,前来分享点经验 整个工程 连接地址 :https://github.com/cuckoosandbox/cuckoo 0x01调试运行 ...

  9. Java基础入门 - 关键字及其分类和说明

    类别 关键字 说明 访问控制 private 私有的 protected 受保护的 public 公共的 类.方法和变量修饰符 abstract 声明抽象 class 类 extends 扩充,继承 ...

  10. typedef struct 与 struct

    学c++之前最好先学c.特别要说的是,一些虽然冠名为c++的项目的文件中却大部分都是c的代码. 比如我们这个例子: 在c语言中,定义一个结构体和其实适合c++中有区别的.比如我们有如下的代码: str ...