title: tensorflow - linear regression does not give intended computational graph
body: <p>I am trying to train a very simple linear regression with tensorflow but the loss doesn't decrease and the tensorboard also doesn't look right</p>
  
  <pre><code>### Generate data
  w_true = np.array([1.0,2.0])
  b_true = 0.5
  
  x_train = np.random.multivariate_normal(mean=[0,0], cov=[[1,0],[0,1]], size=100)
  x_test = np.random.multivariate_normal(mean=[0,0], cov=[[3,0],[0,3]], size=100)
  y_train = np.dot(x_train,w_true) + b_true
  y_test = np.dot(x_test,w_true) + b_true
  
  ### Placeholders for data input
  x = tf.placeholder(dtype=tf.float32, shape=[None,2], name="x")
  y = tf.placeholder(dtype=tf.float32, shape=[None], name="labels")
  
  ### Trainable parameters
  w = tf.Variable(initial_value=np.random.multivariate_normal([0,0],[[1,0],[0,1]]), dtype=tf.float32,
                 name="W")
  b = tf.Variable(initial_value=np.random.normal(1), dtype=tf.float32,name="B")
  
  ### Computational graph
  y_pred = tf.tensordot(x,w,1)+b
  tf.summary.histogram("weights",w)
  tf.summary.histogram("bias",b)
  loss = tf.reduce_sum(tf.squared_difference(y,y_pred), name="loss")
  tf.summary.scalar("loss", loss)
  with tf.name_scope("train"):
      train_step = tf.train.GradientDescentOptimizer(0.00001).minimize(loss)
  
  ### Training
  sess = tf.Session()
  sess.run(tf.global_variables_initializer())
  
  # For TensorBoard
  writer = tf.summary.FileWriter("path_to_some_folder")
  writer.add_graph(sess.graph)
  
  for t in range(1000): 
      x_batch = x_train[np.random.choice(100, 20)]
      y_batch = y_train[np.random.choice(100, 20)]
      sess.run(train_step, {x:x_batch,y:y_batch})
  
  print(sess.run(loss, {x:x_train,y:y_train}))
  print(sess.run(loss, {x:x_test,y:y_test}))
  </code></pre>
  
  <p>I have tried different step sizes but the error always stays above 400 on the training and 1000 on the test set. I have tested that <code>tf.tensordot()</code> behaves like I expect. I you would like to see the tensorboard just replace the <code>path_to_some_folder</code> and after training run <code>tensorboard --logdir path_to_some_folder</code></p>
  
  <p>Thanks very much for the help</p>