Many have heard at some point about neural networks or "artificial intelligence," and we have to be honest: when someone uses those words, it sounds like a total computing Einstein straight out of Terminator 2.
Basically, neural networks are applied when the developer has absolutely no idea how to approach a problem, so they prefer to let the computer "understand" it and do the work of modeling the problem. This is achieved by creating a model (or formula) that needs to be calibrated.
A neural network has two particularities: the functional form or model and the strategy to calibrate it. I’ll talk about these particularities in the order they were named, but first let’s remember what a model or representation of reality is:
A model we all know from physics in high school, when we were taught how springs work, the model was: *extension = K force**, where K had to be measured through experiments and then, with a regression, the model was calibrated. This model had the peculiarity of giving a "straight line," because it is a linear model (as can be seen in the following graph).

I want to make it clear that in this and in every model, there are 3 components:
- Value to predict: In this case, we want to predict the extension
- Input variables or Data: in this case, it’s the force
- Calibration Constants: in this case, K.
A neural network is a NON-LINEAR model. It’s so non-linear that it can take practically any shape and can depend on many variables and has even more constants, and although this non-linear function can take almost any form, its structure is quite clear.
The neural network is made up of many mini-functions, each of which is called: neuron, perceptron, response function, S-curve, or whatever the person typing at that moment pleases. The important thing is that each of these functions is a neuron connected to other neurons. Neurons are connected in layers, where each neuron takes the result from the previous ones, processes it, and passes it to the next sequentially, generating a network that looks like this:

In the diagram above, each red square is an input datum and each circle is a neuron, where each neuron depends on all the data from the previous stage (there can be n layers).
Thus, in our layer W1 we have functions of the form: $f(x_1, x_2, x_3, \ldots, x_n, 1)$, where a simple function could be a linear one: $ f(x_1, x_2, x_3, \ldots, x_n, 1) = B_1 x_1 + B_2 x_2 + B_3 x_3 + \ldots + c $ and, as I said before, this function is up to the programmer, generally determined by trial and error. In general, S-curves or logistic functions are used.
What makes neural networks and most of these artificial intelligence models special is the way they are calibrated. Since they are complex and generally have many input variables and many samples, if we approached them the same way as a linear regression, we would crash even the most powerful NASA computer. Therefore, instead of calibrating, we talk about "training" the neural network.
Training the neural network consists of taking one of the sample cases, applying the model, and seeing the result. If the result is good, keep the network as is; if it’s bad, adjust the parameters a little to make it better, and then repeat with the next sample. After doing this several times for each sample, we will have our trained neural network ready to travel back in time to destroy Skynet.
Update: If you liked the post, go play with neural networks in our other post called Playing with Neural Networks
If you liked it, follow us on any of our channels; all publications will appear there.
And don’t forget to share on your social media; your visits are my motivation.

Leave a Reply