tensorflow dropout

xiaoxiao2021-02-28  30

import tensorflow as tf a = tf.constant([[1.,2.,3.],[4.,5.,6.],[7.,8.,9.]]) a = tf.nn.dropout(a,0.5) b = tf.initialize_all_variables() with tf.Session() as sess: sess.run(b) print(sess.run(a))

输出为:

[[ 2. 4. 6.] [ 8. 10. 0.] [ 0. 0. 0.]]
转载请注明原文地址: https://www.6miu.com/read-2625782.html

最新回复(0)