Consider the following feed forward neural network with inputs $x_1$, $x_2$ and output $y$ and with inflowing weights $w_j$ ($j$ for each row of arrows) for the hidden layer and $u_j$ for the output layer and an activation function $h(x)$ and no bias neurons:

enter image description here

Can one mathematically model this as: $y=h( $$u_1$$h(w_1x_1+w_4x_2)$+$u_2$$h(w_2x_1+w_5x_2)$+$u_3$$h(w_3x_1+w_6x_2)$) and then use that expression after training the neural network for regression (plugging the example directly into the expression to find $y$)?


1 Answer 1


Yes, that expression is right. It represents the feedforward propagation.

Just in case it helps, here is a way of writing that expression with matrix notation (it would be more worthy as the ANN size grows):

$$y = h\left[\begin{pmatrix} u_1 & u_2 & u_3 \end{pmatrix} h\left[ \begin{pmatrix} w_1 & w_4 \\ w_2 & w_5 \\ w_3 & w_6 \\ \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} \right] \right] $$

  • 1
    $\begingroup$ OP seems to say $u_i$ are the weights of output layer $\endgroup$
    – gunes
    Commented Sep 20, 2020 at 10:18
  • $\begingroup$ My bad, thanks for noticing, then I'm wrong and @Essam is correct. In a while I will delete my response to not confuse anyone. $\endgroup$
    – Javier TG
    Commented Sep 20, 2020 at 11:35
  • 1
    $\begingroup$ You can convert your answer into a positive one if you want. $\endgroup$
    – gunes
    Commented Sep 20, 2020 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.