title: Is this Tensorflow bias vector shaped correctly?
body: <p>In the text I read the following:</p>
  
  <p><a href="https://i.stack.imgur.com/0NKXb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0NKXb.jpg" alt="code"></a></p>
  
  <p>I’m confused on the dimensions of the bias vector. How can we add a<code>(m,1)</code> vector to a<code>(1, p)</code> vector?  Is <code>w0</code> shaped correctly? Or should <code>w1</code> be shaped <code>(n, P)</code> to account for <code>P</code> classes, and the we broadcast <code>w0</code>?</p>
  
  <p>Note: I assume <code>w1</code> should me <code>(n, P)</code> so that our matrix multiplication yields a row of unnormalized logits for each class prediction for each observation. Then does it make sense to add a per-class bias and broadcast that to the number of samples in our data?</p>
  
  <p>I feel foolish for even asking but walking through the example I couldn’t reconcile...</p>