title: Tensorflow: why is the outcome of single neural network node without activation function different then my own calculation?
body: <p>i created a single node with 3 inputs and one output with bias 0 and no activation function.
  as far as i understand, the only thing that happens here is a matrix multiplication between the input vector and the randomly initialized weights but when i do the multiplication myself with the same inputs and weights i get a different outcome? what am i missing/doing wrong?</p>
  
  <p>thanks in advance!</p>
  
  <p>i base my calculation on some code provided <a href="https://adventuresinmachinelearning.com/python-tensorflow-tutorial/" rel="nofollow noreferrer">here</a></p>
  
  <p>here is the code:</p>
  
  <pre><code>def example_code(self):
      import tensorflow as tf
  
      data = [[1.0,2.0,3.0]]
      x = tf.placeholder(tf.float32,shape=[1,3],name="mydata")
      node = tf.layers.Dense(units=1)
      y = node(x)
      init = tf.global_variables_initializer()
      sess = tf.Session()
      sess.run(init)
      print("input: "+str(data))
      outcome = sess.run(y,feed_dict={x:data})
      #print("outcome from tensorflow: "+str(outcome))
      weights = node.get_weights()[0]
      bias = node.get_weights()[1]
      print("weights: "+str(weights))
      print("bias: "+str(bias))
      print("outcome from tensorflow: " + str(outcome))
      outcome = tf.matmul(data,weights)
      print("manually calculated outcome: "+str(sess.run(outcome)))
  </code></pre>
  
  <p>output from code:</p>
  
  <pre class="lang-none prettyprint-override"><code>input: [[1.0, 2.0, 3.0]]
  weights: [[ 0.72705185] [-0.70188504] [ 0.5336163 ]]
  bias: [0.]
  outcome from tensorflow: [[-1.3463312]]
  manually calculated outcome: [[0.9241307]]
  </code></pre>