reset_seeds: Reset all random seeds across R, TensorFlow, and Python

View source: R/training.R

reset_seedsR Documentation

Reset all random seeds across R, TensorFlow, and Python

Description

Ensures reproducibility by synchronizing random seeds across:

  • R's random number generator (set.seed()),

  • TensorFlow's random state (tf$random$set_seed()),

  • Python's built-in random module.

Usage

reset_seeds(spec_seed)

Arguments

spec_seed

Integer. The seed value to apply across R, TensorFlow, and Python.

Details

This also clears the current Keras/TensorFlow graph and session before reseeding, preventing residual state from prior model builds.

  • This function is not called automatically within AutoTab. Use it before training runs for reproducibility.

  • Equivalent results still require identical environments (same TensorFlow, CUDA/cuDNN, and library versions).

Value

No return value but will print a confirmation message.

See Also

VAE_train(), set_feat_dist()

Examples


if (reticulate::py_module_available("tensorflow")) {
reset_seeds(1234)
}




autotab documentation built on March 26, 2026, 1:06 a.m.