tensorflow激活函数relu()的详解

tf.nn.relu(features, name = None)

解释:这个函数的作用是计算激活函数relu,即max(features, 0)。即将矩阵中每行的非最大值置0。

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import tensorflow as tf

a = tf.constant([-1.0, 2.0])
with tf.Session() as sess:
    b = tf.nn.relu(a)
    print sess.run(b)
以上程序输出的结果是:[0. 2.]

说明:a中每一个元素与0进行比较,小于0的置为0;大于0的不变。

-----------------------

相关参考:

TensorFlow是谷歌基于DistBelief进行研发的第二代人工智能学习系统,其命名来源于本身的运行原理。Tensor(张量)意味着N维数组,Flow(流)意味着基于数据流图的计算,TensorFlow为张量从流图的一端流动到另一端计算过程。TensorFlow是将复杂的数据结构传输至人工智能神经网中进行分析和处理过程的系统。

TensorFlow可被用于语音识别图像识别等多项机器深度学习领域,对2011年开发的深度学习基础架构DistBelief进行了各方面的改进,它可在小到一部智能手机、大到数千台数据中心服务器的各种设备上运行。TensorFlow将完全开源,任何人都可以用。

原生接口文章

  1. 【Tensorflow】tf.placeholder函数
  2. 【TensorFlow】tf.nn.conv2d是怎样实现卷积的
  3. 【TensorFlow】tf.nn.max_pool实现池化操作
  4. 【Tensorflow】tf.nn.relu函数
  5. 【Tensorflow】tf.reshape 函数
  6. 【Tensorflow】tf.nn.dropout函数
  7. 【Tensorflow】tf.argmax函数
  8. 【Tensorflow】tf.cast 类型转换 函数
  9. 【Tensorflow】tf.train.AdamOptimizer函数
  10. 【Tensorflow】tf.Graph()函数
  11. 【TensorFlow】tf.nn.softmax_cross_entropy_with_logits的用法
  12. 【Tensorflow】tf.dynamic_partition 函数 分拆数组
     原生接口实例

  1. 【Tensorflow】实现简单的卷积神经网络CNN实际代码
  2. 【Tensorflow 实战】实现欧式距离
         slim接口文章

  1. 【Tensorflow】tensorflow.contrib.slim 包
  2. 【Tensorflow slim】 slim.arg_scope的用法
  3. 【Tensorflow slim】slim.data包
  4. 【Tensorflow slim】slim evaluation 函数
  5. 【Tensorflow slim】slim layers包
  6. 【Tensorflow slim】slim learning包
  7. 【Tensorflow slim】slim losses包
  8. 【Tensorflow slim】slim nets包
  9. 【Tensorflow slim】slim variables包
  10. 【Tensorflow slim】slim metrics包
        slim 实例

  1. 【Tensorflow slim 实战】写MobileNet
  2. 【Tensorflow slim 实战】写Inception-V4 Inception-ResNet-v2结构
         kera 接口文章

  1. 【Tensorflow keras】Keras:基于Theano和TensorFlow的深度学习库
  2. 【Tensorflow keras】轻量级深度学习框架 Keras简介
         tensorflow使用过程中的辅助接口或通过tensorflow实现的批量操作接口

  1. 将非RGB图片转换为RGB图片
  2. 【opencv】python3 将图片生成视频文件
  3. 【opencv】selective_search函数


tf.nn.relu(features, name=None)  = max(0,features)


参数:

  • featuresA `Tensor`. 必须类型: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`, `uint16`, `half`.
  • name:名称
返回:Tensor


一般features会是(卷积核,图像)的卷积后加上bias

tf.nn.relu(tf.nn.conv2d(x_image, w_conv1, strides=[1, 1, 1, 1], padding='SAME') + b_conv1)

 
   

这里只讲Tensorflow中relu函数

对于Relu的原理介绍看:http://blog.csdn.net/zj360202/article/details/70256494 

 
  
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zj360202/article/details/70256545

TensorFlow是谷歌基于DistBelief进行研发的第二代人工智能学习系统,其命名来源于本身的运行原理。Tensor(张量)意味着N维数组,Flow(流)意味着基于数据流图的计算,TensorFlow为张量从流图的一端流动到另一端计算过程。TensorFlow是将复杂的数据结构传输至人工智能神经网中进行分析和处理过程的系统。

TensorFlow可被用于语音识别图像识别等多项机器深度学习领域,对2011年开发的深度学习基础架构DistBelief进行了各方面的改进,它可在小到一部智能手机、大到数千台数据中心服务器的各种设备上运行。TensorFlow将完全开源,任何人都可以用。

原生接口文章

  1. 【Tensorflow】tf.placeholder函数
  2. 【TensorFlow】tf.nn.conv2d是怎样实现卷积的
  3. 【TensorFlow】tf.nn.max_pool实现池化操作
  4. 【Tensorflow】tf.nn.relu函数
  5. 【Tensorflow】tf.reshape 函数
  6. 【Tensorflow】tf.nn.dropout函数
  7. 【Tensorflow】tf.argmax函数
  8. 【Tensorflow】tf.cast 类型转换 函数
  9. 【Tensorflow】tf.train.AdamOptimizer函数
  10. 【Tensorflow】tf.Graph()函数
  11. 【TensorFlow】tf.nn.softmax_cross_entropy_with_logits的用法
  12. 【Tensorflow】tf.dynamic_partition 函数 分拆数组
     原生接口实例

  1. 【Tensorflow】实现简单的卷积神经网络CNN实际代码
  2. 【Tensorflow 实战】实现欧式距离
         slim接口文章

  1. 【Tensorflow】tensorflow.contrib.slim 包
  2. 【Tensorflow slim】 slim.arg_scope的用法
  3. 【Tensorflow slim】slim.data包
  4. 【Tensorflow slim】slim evaluation 函数
  5. 【Tensorflow slim】slim layers包
  6. 【Tensorflow slim】slim learning包
  7. 【Tensorflow slim】slim losses包
  8. 【Tensorflow slim】slim nets包
  9. 【Tensorflow slim】slim variables包
  10. 【Tensorflow slim】slim metrics包
        slim 实例

  1. 【Tensorflow slim 实战】写MobileNet
  2. 【Tensorflow slim 实战】写Inception-V4 Inception-ResNet-v2结构
         kera 接口文章

  1. 【Tensorflow keras】Keras:基于Theano和TensorFlow的深度学习库
  2. 【Tensorflow keras】轻量级深度学习框架 Keras简介
         tensorflow使用过程中的辅助接口或通过tensorflow实现的批量操作接口

  1. 将非RGB图片转换为RGB图片
  2. 【opencv】python3 将图片生成视频文件
  3. 【opencv】selective_search函数


tf.nn.relu(features, name=None)  = max(0,features)


参数:

  • featuresA `Tensor`. 必须类型: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`, `uint16`, `half`.
  • name:名称
返回:Tensor


一般features会是(卷积核,图像)的卷积后加上bias

tf.nn.relu(tf.nn.conv2d(x_image, w_conv1, strides=[1, 1, 1, 1], padding='SAME') + b_conv1)

 
 

这里只讲Tensorflow中relu函数

对于Relu的原理介绍看:http://blog.csdn.net/zj360202/article/details/70256494 

 

猜你喜欢

转载自blog.csdn.net/m0_37870649/article/details/80963053
今日推荐