# Seed random variables (Tensorflow)

## Overview

In this tutorial I would quickly show few examples on how to use Tensorflow random seed.

## Tensorflow random seed

If you would like to keep repeatability on your machine learning model results Tensorflow random seed should be a must, but you have to be careful on how to use it.
Operations that rely on a random seed actually derive it from two seeds: the graph-level and operation-level seeds.

Results:

Results:

## example 3: graph-level seed is set againtf.set_random_seed(1)

NOTE: This is a common mistake, if you compare the output of this code with the above you would find that output is different even though both are using the same graph-level seed tf.set_random_seed(1). Make sure you only initialize one graph-level seed ones, other wise you would get different results.

Results:

Results:

## Reference

set_random_seed documentation

## Manuel Cuevas

Hello, I'm Manuel Cuevas a Software Engineer with background in machine learning and artificial intelligence.