I'm writing an article about business management of wine companies where I use a Multi-Layer Perceptron Network.

My teacher then asked me to write an equation that lets me calculate the output of the network. My answer was that due to the nature of multi-layer perceptron networks there is no single equation per se. What I have is a table of weights and bias. I can then use this formula:

$$f(x) = (\sum^{m}_{i=1} w_i * x_i) + b$$


  • m is the number of neurons in the previous layer,
  • w is a random weight,
  • x is the input value,
  • b is a random bias.

Doing this for each layer/neuron in the hidden layers and the output layer.

She showed me an example of another work she made (image on the bottom), telling me that it should be something like that. Looking at the chart, I suppose that it is a logistic regression.

So, my questions are the following:

  1. Is there any equation to predict the output of a multi-layer perceptron network other than iterating over each neuron with $w*x+b$?
  2. Should I just tell my teacher that a logistic regression is a different case and the same does not apply to this type of neural networks?
  3. Is the first formula correct to show that a value of a neuron is the sum product of the previous layers plus the bias?

Example Formula of a network

Edit 1: I didn't wrote the formula but I do also have activation functions (relu).


1 Answer 1


You are forgetting one element of the MLP which is the activation function. If your activation function is linear - then you can simply flatten out all the neurons into one single linear equation. The advantage of MLP however is its non-linearities so I suspect in your network you do have some activation (sigmoid? tanh? relu? etc..).

As for your graph - you could simply output predictions from your MLP and plot the exact scatter plot you have above. The only difference would be you wouldn't have a simple way of expressing this network in algebraic notation (as you have done on the existing x-axis).

To describe networks effectively in text you should look into matrix notation describing the weights and inputs of each layer. Maybe take a look at something like this to get started: https://www.jeremyjordan.me/intro-to-neural-networks/

  • $\begingroup$ Thank you for your answer. I do have activation functions (relu) and the optimizer (adam). The plot is indeed easy and I've done it to compare the target and predicted results. I just got confused because I've never read about getting an equation for a MLP network. I'll tell my teacher again about not being simple to express this network as an algebraic notation. $\endgroup$ Commented Oct 14, 2020 at 21:19
  • $\begingroup$ Yes that's fair. Your only option for communicating the exact "formula" would be the matrix notation of your specific architecture along with a (large) text file with the values of all the weights :) $\endgroup$ Commented Oct 14, 2020 at 21:37

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.