Q: Given the weight matrix $\mathbf{W}$ and input vector $\mathbf{x}$ below, how do you compute the matrix multiplication $\mathbf{W}\mathbf{x}$ , add the bias vector $\mathbf{b}$ , and determine the final result?

$$ \mathbf{W} = \begin{bmatrix} 2 & 3 \\ 1 & 4 \end{bmatrix}, \quad \mathbf{x} = \begin{bmatrix} 5 \\ 6 \end{bmatrix}, \quad \mathbf{b} = \begin{bmatrix} 1 \\ 2 \end{bmatrix} $$

A: The calculation proceeds in the following steps:

  1. Matrix multiplication: Multiply the matrix $\mathbf{W}$ with the vector $\mathbf{x}$ :

    $$ \mathbf{W}\mathbf{x} = \begin{bmatrix} 2 & 3 \\ 1 & 4 \end{bmatrix} \begin{bmatrix} 5 \\ 6 \end{bmatrix} $$

    Perform element-wise calculations:

    $$ \begin{bmatrix} 2(5) + 3(6) \\ 1(5) + 4(6) \end{bmatrix} \begin{bmatrix} 10 + 18 \\ 5 + 24 \end{bmatrix} \begin{bmatrix} 28 \\ 29 \end{bmatrix} $$

  2. Adding the bias vector: Add the bias vector $\mathbf{b}$ to the result of the matrix multiplication:

    $$ \mathbf{W}\mathbf{x} + \mathbf{b} = \begin{bmatrix} 28 \\ 29 \end{bmatrix} + \begin{bmatrix} 1 \\ 2 \end{bmatrix} $$

    Perform element-wise addition:

    $$ \begin{bmatrix} 28 + 1 \\ 29 + 2 \end{bmatrix}= \begin{bmatrix} 29 \\ 31 \end{bmatrix} $$

Final Answer: The result after performing the matrix multiplication and adding the bias is $\begin{bmatrix} 29 \\ 31 \end{bmatrix}$.