To better digest all the concepts, let's now create a simple linear regression model. First, we have to import all the libraries and set a random seed, both for NumPy and TensorFlow (so that we'll all have the same results):
import tensorflow as tfimport numpy as npfrom datetime import datetimenp.random.seed(10)tf.set_random_seed(10)
Then, we can create a synthetic dataset consisting of 100 examples, as shown in the following screenshot:
Because this is a linear regression example, y = W * X + b, where W and b are arbitrary values. In this example, we ...