Sets all random seeds (Python, NumPy, and backend framework, e.g. TF).
Source:R/utils.R
set_random_seed.Rd
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.
This sets:
the R session seed:
set.seed()
the Python session seed:
import random; random.seed(seed)
the Python NumPy seed:
import numpy; numpy.random.seed(seed)
the TensorFlow seed:
tf$random$set_seed(seed)
(only if TF is installed)The Torch seed:
import("torch")$manual_seed(seed)
(only if the backend is torch)and disables Python hash randomization.
Note that the TensorFlow seed is set even if you're not using TensorFlow
as your backend framework, since many workflows leverage tf$data
pipelines (which feature random shuffling). Likewise many workflows
might leverage NumPy APIs.
See also
Other utils: audio_dataset_from_directory()
clear_session()
config_disable_interactive_logging()
config_disable_traceback_filtering()
config_enable_interactive_logging()
config_enable_traceback_filtering()
config_is_interactive_logging_enabled()
config_is_traceback_filtering_enabled()
get_file()
get_source_inputs()
image_array_save()
image_dataset_from_directory()
image_from_array()
image_load()
image_smart_resize()
image_to_array()
layer_feature_space()
normalize()
pad_sequences()
split_dataset()
text_dataset_from_directory()
timeseries_dataset_from_array()
to_categorical()
zip_lists()