caffe中的sgd,与激活函数(activation function)
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.
- Optional
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]
- Optional
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)的更多相关文章
- 激活函数-Activation Function
该博客的内容是莫烦大神的授课内容.在此只做学习记录作用. 原文连接:https://morvanzhou.github.io/tutorials/machine-learning/tensorflow ...
- 浅谈深度学习中的激活函数 - The Activation Function in Deep Learning
原文地址:http://www.cnblogs.com/rgvb178/p/6055213.html版权声明:本文为博主原创文章,未经博主允许不得转载. 激活函数的作用 首先,激活函数不是真的要去激活 ...
- The Activation Function in Deep Learning 浅谈深度学习中的激活函数
原文地址:http://www.cnblogs.com/rgvb178/p/6055213.html 版权声明:本文为博主原创文章,未经博主允许不得转载. 激活函数的作用 首先,激活函数不是真的要去激 ...
- 《Noisy Activation Function》噪声激活函数(一)
本系列文章由 @yhl_leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/51736830 Noisy Activa ...
- MXNet 定义新激活函数(Custom new activation function)
https://blog.csdn.net/weixin_34260991/article/details/87106463 这里使用比较简单的定义方式,只是在原有的激活函数调用中加入. 准备工作下载 ...
- 激活函数:Swish: a Self-Gated Activation Function
今天看到google brain 关于激活函数在2017年提出了一个新的Swish 激活函数. 叫swish,地址:https://arxiv.org/abs/1710.05941v1 pytorch ...
- TensorFlow Activation Function 1
部分转自:https://blog.csdn.net/caicaiatnbu/article/details/72745156 激活函数(Activation Function)运行时激活神经网络中某 ...
- caffe中各层的作用:
关于caffe中的solver: cafffe中的sover的方法都有: Stochastic Gradient Descent (type: "SGD"), AdaDelta ( ...
- ML 激励函数 Activation Function (整理)
本文为内容整理,原文请看url链接,感谢几位博主知识来源 一.什么是激励函数 激励函数一般用于神经网络的层与层之间,上一层的输出通过激励函数的转换之后输入到下一层中.神经网络模型是非线性的,如果没有使 ...
随机推荐
- speex编译
首先去官网 https://www.speex.org/downloads/ 下载解压 将include.libspeex文件夹复制到自己新建工程的jni目录下 speex有关的类 package c ...
- 性能测试工具LoadRunner24-LR之Analysis 系统资源分析
1.内存分析方法 内存分析方法主要是用于判断系统有无遇到内存瓶颈,是否需要通过增加内存等手段提高系统性能表现.主要计数器包括Memory和Physical Disk类别的计数器 内存分析的主要步骤和方 ...
- 对象池2(方法功能)Pools
对象池Pools(主要调用方法功能) namespace kernal { public class Pools : MonoBehaviour { [HideInInspector] public ...
- (转)centOS wget的使用
摘要:CentOS wget是一个从网络上自动下载文件的自由工具.它支持HTTP,HTTPS和FTP协议,可以使用HTTP代理. 所谓的自动下载是指,CentOS wget可以在用户退出系统的之后在后 ...
- 为什么阿里云服务器的docker启动tomcat这么慢??
https://blog.csdn.net/tianyiii/article/details/79314597 最近在阿里云服务器使用Docker启动Tomcat,发现tomcat服务器启动过程很慢. ...
- HDU 4738——Caocao's Bridges——————【求割边/桥的最小权值】
Caocao's Bridges Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
- 介绍几个关于C/C++程序调试的函数
最近调试程序学到的几个挺有用的函数,分享一下,希望对用C/C++的朋友有所帮助! 1. 调用栈系列下面是函数原型: 1 2 3 4 #include "execinfo .h" i ...
- 先定个小目标, 使用C# 开发的千万级应用
dotNET跨平台 微信号 opendotnet 功能介绍 在这里你可以谈微软.NET,Mono的跨平台开发技术,也可以谈谈其他的跨平台技术.在这里可以让你的.NET项目有新的思路,不局限于微软的技术 ...
- 为什么地址栏的快捷键是Alt D
博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:为什么地址栏的快捷键是Alt D.
- Linux 学习 二, 安装JDK
我是利用在window环境下载好JDK,然后传到VMware中linux中 下载JDK http://www.oracle.com/technetwork/java/javase/downloads/ ...