Skip to content Skip to sidebar Skip to footer

`tf.set_random_seed()` Equivalent For Operations Seed?

Title pretty much explains everything. Do you know if there exists an equivalent to tf.set_random_seed() for the operations seed in tensorflow. I'm trying to initialize exactly sam

Solution 1:

According to the documentation of tf.set_random_seed() setting only the graph level seed should achieve what you are looking for:

If the graph-level seed is set, but the operation seed is not: The system deterministically picks an operation seed in conjunction with the graph-level seed so that it gets a unique random sequence.

To make the random sequences generated by all ops be repeatable across sessions, set a graph-level seed

But you have to remember to call tf.set_random_seed() for both graphs individually with the same seed.

But that might still not work, especially if the graphs are executed on different devices (I am not sure about that). A safe option to make sure both graphs are using the same initialization might be to simply initialize one of the two and then just set the variables in the second one to the values of the first.

Post a Comment for "`tf.set_random_seed()` Equivalent For Operations Seed?"