## 2 Models and Methods
### Machine Learning Prediction  
The methodology used is based on supervised learning techniques. From a layer with the input data, the input layer, it is sought to predict one or more labeled variables located in the last layer, the output layer. Between both, there are some interconnected, hidden layers. Depending on the complexity of the problem, the hidden layers vary in their number of nodes and layers. The algorithm used to solve the SNN is divided into three steps, forward propagation, backward propagation and weights update. In addition, the Adam optimizer has been used to speed up and improve convergence. The full operation is shown in Figure 1.  
Figure 1 shows in detail the classical neural network methodology from the achievement of each of the variables in a specific layer. As can be seen, the method is divided in three stages, forward propagation, backward propagation and update. The steps carried out for the computation of each of the variables are introduced in the following paragraphs. First, the information provided by the input data, in the input layer, is propagated through the hidden layers by the connections between the nodes until the variable of interest is predicted in the output layer. This is called forward propagation and is divided into two steps. In the first, given by the Equation (1), the nodes of the layer \(l\) are fitted to a linear equation \(Z^{[l]}\) considering the bias and the kernel weights, \(b^{[l]}\) and \(W^{[l]}\), and the predicted values of the previous layer, \(A^{[l-1]}\). In the second, given by Equation (2), the activation of the obtained values in layer \(l\) by the previous equation is carried out. The most common activations are shown in Figure 2.  
\[Z^{[l]}=W^{[l]}.A^{[l-1]}+b \tag{1}\]  
\[A^{[l]}=g^{[l]}\Big{(}Z^{[l]}\Big{)} \tag{2}\]  
Figure 1: Schematic description of the operation of the neural network in layer \(l\). When the predicted values correspond to the last layer L (or output layer), the second stage begins, called backward propagation and given by the Equation (3). This commences by determining the error between the predicted variable \(\hat{Y}\), and the real variable \(Y\). Once this deviation is known, the information is propagated to the input layer by determining the derivatives of the layer function \(dZ^{[l]}\) using the chain rule. The bias weight is not considered because its influence with respect to the kernel weight is negligible. \[\partial Z^{[l]}=\left\{ \begin{array}{c}\sqrt{\frac{\sum_{i=1}^{N}\left(Y_{ i}-\overline{Y}_{i}\right)^{2}}{N}}\ \ if\ l=L\\ W^{[l+1]}.\partial Z^{[l+1]}*g^{[l]^{\prime}}\left(Z^{[l]}\right)\ else\end{array} \right. \tag{3}\]  
where \(\overline{Y}\) corresponds to the mean of the output variable, \(N\) is the total number of values, and \(g^{[l]^{\prime}}\left(Z^{[l]}\right)\) is the derivative of the activation function considered in layer \(l\). At this stage, the error determined is also propagated through the kernel and bias weights with the purpose of obtain the optimal settings for them, Equations (4) and (5) respectively. \[\partial W^{[l]}=\frac{1}{N}.\partial Z^{[l]}.A^{[l-1]} \tag{4}\]  
\[\partial b^{[l]}=\frac{1}{N}\cdot\sum_{i=1}^{N}\partial Z^{[l]} \tag{5}\]  
Finally, the kernel and bias weights are updated with the Adam optimizer, Equations (6) and (7) respectively. \[W^{[l]}=W^{[l]}-\alpha\cdot\frac{V_{\partial W}}{\sqrt{S_{\partial W}+\epsilon}} \tag{6}\]  
Figure 2: Common activation functions used in neural networks problem. (**a**) Linear: \(g(Z)=Z\); (**b**) rectified linear unit (ReLU): \(g(Z)=max(0,\,Z)\); (**c**) sigmoid: \(g(Z)=1/\left(1+e^{-Z}\right)\); (**d**) hyperbolic tangent (tanh): \(g(Z)=\left(e^{Z}-e^{-Z}\right)/\left(e^{Z}+e^{-Z}\right)\). where \(\alpha\) is the learning rate, \(V_{\partial W}\) and \(S_{\partial W}\) are Adam optimizer kernel weights, computed with Equations (8) and (9) respectively, and \(\varepsilon\) is a small number to prevent zero division.