|View source on GitHub|
Sets all random seeds for the program (Python, NumPy, and TensorFlow).
tf.keras.utils.set_random_seed( seed )
You can use this utility to make almost any Keras program fully deterministic. Some limitations apply in cases where network communications are involved (e.g. parameter server distribution), which creates additional sources of randomness, or when certain non-deterministic cuDNN ops are involved.
Calling this utility is equivalent to the following:
import random import numpy as np import tensorflow as tf random.seed(seed) np.random.seed(seed) tf.random.set_seed(seed)
||Integer, the random seed to use.|