weights=tf.Variable(tf.random_uniform([1],-1,1))#difine the weights,the range of weights is (-1,1) and the dim is 1
biases=tf.Variable(tf.zeros([1]))#
y=x_data*weights+biases
Loss=tf.reduce_mean(tf.square(y-y_data))#difine the loss
optimizor=tf.train.GradientDescentOptimizer(0.5)#define the optimizor,the learnning rate is 0.5
train=optimizor.minimize(Loss)
init=tf.initialize_all_variables() #it is very important to initialize
sess=tf.Session()
sess.run(init)
for step in range(201):
sess.run(train)
if step%20==0:
print(step,sess.run(weights),sess.run(biases))