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链接,感谢几位博主知识来源 一.什么是激励函数 激励函数一般用于神经网络的层与层之间,上一层的输出通过激励函数的转换之后输入到下一层中.神经网络模型是非线性的,如果没有使 ...
随机推荐
- Mybatis学习笔记13 - 动态sql之set标签
示例代码: 接口定义: package com.mybatis.dao; import com.mybatis.bean.Employee; public interface EmployeeMapp ...
- Android官方架构组件介绍之ViewModel(三)
ViewModel 像Activity,Fragment这类应用组件都有自己的生命周期并且是被Android的Framework所管理的.Framework可能会根据用户的一些操作和设备的状态对Act ...
- python 横向比较最大值 贴标签
df['dfda']=pd.Series(df[['a','b','v']].idxmax(axis=1),index=df.index)#横向比较最大值并返回列名,比循环快N倍
- Hadoop Intro - Configure
Hadoop学习(二) Hadoop配置文件参数详解 Hadoop运行模式分为安全模式和非安全模式,在这里,我将讲述非安全模式下,主要配置文件的重要参数功能及作用,本文所使用的Hadoop版本为2 ...
- bcc-tools安装
1 一. 安装cmake cmake是一种跨平台的编译工具,安装过程如下: 下载源码包:https://cmake.org/files/v3.8/cmake-3.8.0.tar.g ...
- jQuery 间歇式无缝滚动特效分享(三张图片平行滚动)
最近项目中门户首页需要做出图片间歇式无缝滚动特效,但是在网上找资料都是不太理想,不过可以指导.最后自己写了一个demo实现了这个特效,分享出来. 1.jquery.cxscroll.js /*! * ...
- 高精度运算——java
java大法 java的框架. import java.io.*; import java.util.*; import java.math.*; public class Main{ public ...
- (转)GitHub上整理的一些工具,求补充 -
SegmentFault 技术站点 Hacker News:非常棒的针对编程的链接聚合网站 Programming reddit:同上 MSDN:微软相关的官方技术集中地,主要是文档类 infoq ...
- flexbox预习
创建一个flexbox: .flex-container{ display:flex; } flex-direction: column;//将flex排成一列 flex-direction: co ...
- python3绘图示例5(基于matplotlib:正弦图等)
#!/usr/bin/env python# -*- coding:utf-8 -*- import numpy as npimport pylab as pyimport matplotlib as ...