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)
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)