# Efficient Implementation of Multilayer Perceptrons: Reducing Execution Time and Memory Consumption
## 4 Conclusions  
It should be stressed that the proposed method really does save memory and also improves runtime. Equation (4) shows that the traditional method stores more memory as the number of neurons increases. This is because the traditional method has an exponential growth of consumption that grows very fast. However, with the proposed method, this does not happen, since the important thing is not the number of neurons, but the number of connections between them, so that the memory consumption is not so abusive (see Table 3).  
The proposed method avoids the exponential memory consumption, and although it also improves the execution time, the improvement is not so drastic. In Tables 4 and 5, it can be observed that the algorithm works better when it has more layers and these, in turn, have many neurons. Moreover, as can be seen in the tables previously mentioned, the proposed method takes much better advantage of the compiler optimizations.  
Figure 6: Speed-up up improvement of the proposed method vs. the traditional method in network execution on a server. (**a**) Without using the compiler optimization flags; (**b**) using the compiler optimization flags “-O3 -ffast-math -funroll-loops -ffree-vectorize -march=native”.  
Also, it should be pointed out that the proposed method assumes that everything put into it is correct. In the example of Figure 3, where neurons 0 and 3 do not have a weight, using the \(w_{ij}\) formula (Equation (3)) will give you a value for the weight \(w_{03}\), when in fact, this does not exist. Thus, in this method, we only need to enter the correct values for a feedforward network.  
It is important to note that the method proposed in this paper only works for fully forward connected networks. Other types such as recurrent networks would not be able to store all the weights. For instance, for a network with four neurons in the input layer, three in the hidden layer and two in the output layer, the \(w_{ij}\) formula (Equation (3)) would return the same value when retrieving the values of \(w_{65}\) and \(w_{68}\).  
Although the proposed method is created for feedforward networks, its internal structure allows for the use of techniques that are commonly used in networks such as MLP; an example is the dropout technique where connections can be removed from a network. To carry out this technique of dropping connections, it would simply be necessary to set the connection value to zero [24].  
Finally, it is important to mention that the proposed method can involve the use of networks in IoT or ubiquitous computing devices using modest hardware [25; 26]. Devices such as the Arduino Mega have only 256 Kb of memory, making it impossible to use networks using the traditional method [27].  
Conceptualization, F.C.; Methodology S.R.-Y., S.A.-G. and F.C.; Software, F.C.; Validation, A.B.P.-P and F.C.; Writing--draft preparation, S.A.-G. and F.C.; Writing--review and editing A.R.-R. and F.C.; Visualization, A.B.P.-P. and F.C.; Funding acquisition S.R.-Y. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
Not applicable.  
Data Availability Statement: Data is contained within the article.  
We are particularly grateful to CESGA (Galician Supercomputing Centre) for providing access to their infrastructure.  
The authors declare no conflicts of interest.  
The following abbreviations are used in this manuscript.  
Artificial neural network  
MLP Multilayer perceptron  
PEs Process elements