title: weight matrix dimension intuition in a neural network
body: <p>I have been following a course about neural networks in Coursera and came across this model:</p>
  
  <p><a href="https://i.stack.imgur.com/xxfG9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xxfG9.png" alt="enter image description here"></a></p>
  
  <p>I understand that the values of z1, z2 and so on are the values from the linear regression that will be put into an activation function. The problem that I have is when the author says that there should be one matrix of weights and a vector of the inputs, like this:</p>
  
  <p><a href="https://i.stack.imgur.com/udX05.png" rel="noreferrer"><img src="https://i.stack.imgur.com/udX05.png" alt="enter image description here"></a></p>
  
  <p>I know that the vector of Xs has a dimension of 3 x 1 because there are three inputs, but why the array of Ws is of dimensions 4 x 3?. I can deduct that it has four rows because those are the weights w1, w2, w3 and w4 that they correspond to each ones of the values of a1...a4, but what is inside that array? Its elements are something like:</p>
  
  <pre><code>w1T w1T w1T
  w2T w2T w3T
  ... ?
  </code></pre>
  
  <p>so when I multiply by x1, for example, I will get:</p>
  
  <pre><code>w1Tx1+w1Tx2+w1Tx3=w1T(x1+x2+x3)=w1TX
  </code></pre>
  
  <p>I have think about it, but I cannot really get a grasp about what this array contains, even though I know that at the end I will have a vector of 4 x 1 that corresponds to the values of z. Any help?</p>
  
  <p>Thanks</p>