tf.nn.relu

import tensorflow as tf

a = tf.constant([-1.0, 1.0])
with tf.Session() as sess:
    b = tf.nn.relu(a)
    # [ 0.  1.]
    print(sess.run(b))

激活函数

这个函数的作用是计算激活函数relu,即max(features, 0)

tf.nn.relu

其他激活函数

原文地址:https://www.cnblogs.com/guqiangjs/p/7807625.html