Answers.Body: <ol>
  <li><p>You can choose the number of neurons you want for your hidden layer. You have to try in order to see which number of neurons makes the neural network work better.</p>
  </li>
  <li><p>It seems you missed something:</p>
  </li>
  </ol>
  <p>You will need two weights matrices, one for the hidden layer and one for the output layer.</p>
  <p>Without the bias, the hidden layer weights matrix, will have 3 rows because there are 3 input features, and 3 columns because there are 3 hidden neurons. So you can multiply it with the input matrix you named X.</p>
  <p>It will result in another 3x3 matrix, we can name X_hidden.</p>
  <p>The output layer weights matrix, will have 3 rows, as there are also 3 inputs for this layer: the 3 outputs of the hidden layer. And it will have only 2 columns, because there are 2 output neurons.</p>
  <p>So you also can multiply it with the X_hidden matrix. It will result in a 3 rows, and 2 columns matrix.</p>
  <p>About neuron 1 in the hidden layer, its matrix will have 1 column because we consider only one neuron, and 3 rows because of the 3 input features (without bias). So you can multiply it with the X matrix that have 3 columns.</p>
  <p>It will result in a 3 rows, and 1 column matrix.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-21T07:27:45.310Z
Answers.LastActivityDate: 2023-04-21T07:37:41.150Z
Answers.LastEditDate: 2023-04-21T07:37:41.150Z
Answers.UserDisplayName: Bertrand125
Body: <p>I'm finding myself confused everytime when I want to visualize a Neural net with input vectors and weights. Given a input like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Input 1</th>
  <th>Input 2</th>
  <th>Input 3</th>
  <th>Output</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>2</td>
  <td>3</td>
  <td>1</td>
  </tr>
  <tr>
  <td>3</td>
  <td>4</td>
  <td>6</td>
  <td>0</td>
  </tr>
  <tr>
  <td>6</td>
  <td>8</td>
  <td>1</td>
  <td>1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Assuming that I have 1 hidden layer with 3 neurons and 2 output neurons, I would like to know if my understanding of this simple neural net in a Matrix notation is correct?</p>
  <p>X = <span class="math-container">\begin{bmatrix}1&amp;2&amp;3\\3&amp;4&amp;6\\6&amp;8&amp;1\end{bmatrix}</span></p>
  <p>My weights Matrix would then look like:</p>
  <p>W = <span class="math-container">\begin{bmatrix}W_{11}&amp;W_{12}&amp;W_{13}\\W_{21}&amp;W_{22}&amp;W_{23}\end{bmatrix}</span></p>
  <p>Assuming the bias to be 0, my multi-variate summation equation for Neuron 1 in the hidden layer will look like (in a Matrix dot product representation):</p>
  <p>First I guess I cannot multiply both the Matrices as it does not satisfy the rule where number or columns from Matrix 1 (in my case Matrix X) should equal the number of rows from Matrix 2 (my weights Matrix w). Correct?</p>
  <p>So my questions are now:</p>
  <ol>
  <li><p>Should I then choose my hidden layer to have 3 neurons?</p>
  </li>
  <li><p>Is my overall understanding of the whole concept correct?</p>
  </li>
  </ol>
  
Tags: <neural-networks><vectors>
Title: How to Represent a Multi-Feature Input Vector in a Neural Net
UserDisplayName: joesan
ThreadText: # How to Represent a Multi-Feature Input Vector in a Neural Net
  
  (Asked by: username_0 on 2023-04-16)
  
  I'm finding myself confused everytime when I want to visualize a Neural net with input vectors and weights. Given a input like this:
  
  | Input 1 | Input 2 | Input 3 | Output |
  | --- | --- | --- | --- |
  | 1 | 2 | 3 | 1 |
  | 3 | 4 | 6 | 0 |
  | 6 | 8 | 1 | 1 |
  
  Assuming that I have 1 hidden layer with 3 neurons and 2 output neurons, I would like to know if my understanding of this simple neural net in a Matrix notation is correct?
  
  X = \begin{bmatrix}1&2&3\\3&4&6\\6&8&1\end{bmatrix}
  
  My weights Matrix would then look like:
  
  W = \begin{bmatrix}W\_{11}&W\_{12}&W\_{13}\\W\_{21}&W\_{22}&W\_{23}\end{bmatrix}
  
  Assuming the bias to be 0, my multi-variate summation equation for Neuron 1 in the hidden layer will look like (in a Matrix dot product representation):
  
  First I guess I cannot multiply both the Matrices as it does not satisfy the rule where number or columns from Matrix 1 (in my case Matrix X) should equal the number of rows from Matrix 2 (my weights Matrix w). Correct?
  
  So my questions are now:
  
  1. Should I then choose my hidden layer to have 3 neurons?
  2. Is my overall understanding of the whole concept correct?
  
  **Tags:** neural-networks, vectors
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-04-21. Score: 0
  
  1. You can choose the number of neurons you want for your hidden layer. You have to try in order to see which number of neurons makes the neural network work better.
  2. It seems you missed something:
  
  You will need two weights matrices, one for the hidden layer and one for the output layer.
  
  Without the bias, the hidden layer weights matrix, will have 3 rows because there are 3 input features, and 3 columns because there are 3 hidden neurons. So you can multiply it with the input matrix you named X.
  
  It will result in another 3x3 matrix, we can name X\_hidden.
  
  The output layer weights matrix, will have 3 rows, as there are also 3 inputs for this layer: the 3 outputs of the hidden layer. And it will have only 2 columns, because there are 2 output neurons.
  
  So you also can multiply it with the X\_hidden matrix. It will result in a 3 rows, and 2 columns matrix.
  
  About neuron 1 in the hidden layer, its matrix will have 1 column because we consider only one neuron, and 3 rows because of the 3 input features (without bias). So you can multiply it with the X matrix that have 3 columns.
  
  It will result in a 3 rows, and 1 column matrix.
  
  
  ---
  
  