標籤:

tf.set_random_seed

import tensorflow as tfntf.set_random_seedndir(tf.set_random_seed)nhelp(tf.set_random_seed)nnn# tf.set_random_seed(1234)na = tf.random_uniform([1], seed=1)nb = tf.random_normal([1], seed=2)nwith tf.Session() as sess1:n print(sess1.run(a))n print(sess1.run(a))n print(sess1.run(b))n print(sess1.run(b))nwith tf.Session() as sess2:n print(sess2.run(a))n print(sess2.run(a))n print(sess2.run(b))n print(sess2.run(b))nntf.set_random_seed(1234)na = tf.random_uniform([1])nb = tf.random_normal([1])nnwith tf.Session() as sess1:n print(sess1.run(a))n print(sess1.run(a))n print(sess1.run(b))n print(sess1.run(b))nwith tf.Session() as sess2:n print(sess2.run(a))n print(sess2.run(a))n print(sess2.run(b))n print(sess2.run(b))n

推薦閱讀:

資源|100精品開源項目助你成為TensorFlow專家(一)
CNN中卷積層的計算細節
tensorflow讀取數據-tfrecord格式
如何使用最流行框架Tensorflow進行時序預測和時間序列分析
乾脆面君,你給我站住!你已經被TensorFlow盯上了

TAG:TensorFlow |