caffe激活层(Activiation Layers)

在激活层中,对输入数据进行激活操作(实际上就是一种函数变换),是逐元素进行运算的。从bottom得到一个blob数据输入,运算后,从top输入一个blob数据。在运算过程中,没有改变数据的大小,即输入和输出的数据大小是相等的。

输入:n*c*h*w

输出:n*c*h*w

常用的激活函数有sigmoid, tanh,relu等

1、Sigmoid

  原型:

    

层类型:Sigmoid

 layer {
name: "encode1neuron"
bottom: "encode1"
top: "encode1neuron"
type: "Sigmoid"
}

2、ReLU / Rectified-Linear and Leaky-ReLU

  

ReLU是目前使用最多的激活函数,主要因为其收敛更快,并且能保持同样效果。

标准的ReLU函数为max(x, 0),当x>0时,输出x; 当x<=0时,输出0

f(x)=max(x,0)

层类型:ReLU

可选参数:

  negative_slope:默认为0. 对标准的ReLU函数进行变化,如果设置了这个值,那么数据为负数时,就不再设置为0,而是用原始数据乘以negative_slope

 layer {
name: "relu1"
type: "ReLU"
bottom: "pool1"
top: "pool1"
}

3、TanH / Hyperbolic Tangent

利用双曲正切函数对数据进行变换。

层类型:TanH

layer {
name: "layer"
bottom: "in"
top: "out"
type: "TanH"
}

4、Absolute Value

求每个输入数据的绝对值。

f(x)=Abs(x)

层类型:AbsVal

 layer {
name: "layer"
bottom: "in"
top: "out"
type: "AbsVal"
}

5、Power

对每个输入数据进行幂运算

f(x)= (shift + scale * x) ^ power

层类型:Power

可选参数:

  power: 默认为1

  scale: 默认为1

  shift: 默认为0

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

6、BNLL

binomial normal log likelihood的简称

f(x)=log(1 + exp(x))

层类型:BNLL

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

参考:http://www.cnblogs.com/denny402/p/5072507.html

最新文章

  1. ngx_http_core_module模块.md
  2. fir.im Weekly - 让 iOS 应用更加安全
  3. canvas刮刮乐和画笔
  4. 嵌入式Linux开发板
  5. linux软件包的安装和卸载
  6. Quartz.NET总结(三)Quartz 配置
  7. 警卫安排(dp好题)
  8. fcitx中文输入法
  9. Qt之加密算法
  10. 浅谈java的String字符串
  11. 耍一把codegen,这样算懂编译么?
  12. *C语言有关指针的变量声明中的几个易错点
  13. Java实验报告
  14. mysql的&quot;双1设置&quot;-数据安全的关键参数(案例分享)
  15. 任务调度及远端管理(基于Quartz.net)
  16. 如何开发一个 PyCharm 插件
  17. div中内容超出自动换行
  18. PHP提取字符串中的手机号正则表达式怎么写
  19. shell与正则表达式
  20. python调用其他文件的类和函数

热门文章

  1. spring4-2-bean配置-11-基于注解
  2. 洛谷 P2986 [USACO10MAR]伟大的奶牛聚集Great Cow Gat…(树规)
  3. python算法 - 快速寻找满足条件的两个数-乾颐堂
  4. windows cmd命令相关知识和经验的碎片化记录
  5. ajax中 XmlHttp的open( )方法
  6. 白盒测试实践--Day3 12/19/2017
  7. 第01章 ElasticSearch简介
  8. 试题 B: 不同子串 蓝桥杯
  9. python抓网页数据【ref:http://www.1point3acres.com/bbs/thread-83337-1-1.html】
  10. Delphi xe5 控件TIdhttp的用法post,get解决中文乱码问题