激活函数-dropout

来源:互联网 发布:怎么创建数据库实例 编辑:程序博客网 时间:2024/06/06 13:42
import tensorflow as tfa = tf.constant([[-1.0, 2.0, 3.0, 4.0]])with tf.Session() as sess:    b = tf.nn.dropout(a, 0.5, noise_shape = [1,4])    print sess.run(b)    b = tf.nn.dropout(a, 0.5, noise_shape = [1,1])    print sess.run(b)


[[-0.  0.  6.  0.]]
[[-0.  0.  0.  0.]]
原创粉丝点击