In [1]:
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
In [2]:
# We define the model parameters w and b as variables 
# with initial values of [.3] and [-0.3], respectively:
w = tf.Variable([.3], tf.float32)
b = tf.Variable([-.3], tf.float32)
In [3]:
x = np.arange(1,5)
In [4]:
y = w * x + b

print(y)

plt.plot(x,y)
plt.show()
tf.Tensor([0.         0.3        0.6        0.90000004], shape=(4,), dtype=float32)