title: How to obtain the random seed from TensorFlow?
body: <p>I want to be able to reproduce training sessions of Neural Networks in TensorFlow. When I run TensorFlow I assume it has some rand state that makes it choose some specific initialization for the variables. This is what I think I am mostly interested in reproducing. I think I can successfully reproduce the SGD steps because I am able to obtain the numpy seed that makes me have random choices of batches (see <a href="https://stackoverflow.com/questions/20911147/choose-random-seed-and-save-it/38165503#38165503">this</a>). Since the nature of numpy is to have a weird tuples for keeping random seends, re-using that state to make a seed in TensorFlow is unclear to me. Is it possible to get the TensorFlow random seed?</p>
  
  <hr>
  
  <p>I did read some of <a href="https://www.tensorflow.org/versions/r0.9/api_docs/python/constant_op.html#set_random_seed" rel="nofollow noreferrer">the documentation of TensorFlow on random seeds</a> and it seems that it mainly says how to set seeds rather than read them. Does this mean that the best way to get a random seed from TensorFlow is by asking the computers OS to get a random number? Or maybe to ask <a href="https://docs.python.org/2/library/random.html" rel="nofollow noreferrer">python for a random seed</a> when it runs? Or maybe a combination of those plus the current time or something like that?</p>
  
  <p>Maybe something like:</p>
  
  <pre><code>random.seed()
  random_seed = random.getstate()
  tf_set_random_seed(random_seed)
  </code></pre>
  
  <hr>
  
  <p>I've decided to do:</p>
  
  <pre><code>rand = int(os.urandom(64).encode('hex'), 16)
  results['tf_rand_seed'] = rand
  tf.set_random_seed(rand)
  </code></pre>
  
  <p>is that a good idea?</p>