## 5 Conclusions  
The two distributed implementations of the PSO algorithm presented serve to demonstrate the feasibility of their use in training deep neural networks in a distributed environment. The asynchronous DAPSO implementation demonstrates superior performance and accuracy compared to the synchronous DSPSO implementation. It achieves this by performing the tasks of fitness evaluation and particle updating in a fully parallel and independent manner by the workers of an Apache Spark cluster, resulting in highly satisfactory results in terms of performance and scalability. It has been observed that, in cases where the number of samples is limited, the problem size may not be sufficient for DAPSO to achieve optimal performance. However, the MSE obtained with both variants is similar for a significant amount of data, and DAPSO is demonstrably superior in terms of performance to the synchronous DSPSO implementation. This is evidenced by the improvement in processing times observed in both the regression problem with 175,104 samples and the classification problem presented here. In the latter case, due to the considerable size of the dataset, comprising 127,405 samples in the training set and 68 features used for classification, a significant improvement in execution times is achieved.  
In terms of implementation on an Apache Spark cluster, the DAPSO variant demonstrates superior performance compared to the DSPSO variant. While the programs developed with Spark can be executed on diverse distributed platforms, this work exclusively presents results from execution on a departmental GPU cluster. As future work, we intend to adapt the presented algorithms for deployment on alternative platforms, such as Kubernetes or Databricks.  
**Author Contributions:** In this study, all authors contributed equally to the research and writing process, with responsibilities shared collaboratively across all stages of the project. All authors have read and agreed to the published version of the manuscript.  
**Funding:** This research was funded by the Spanish Ministry of Science and Innovation (Ministerio de Ciencia e Innovacion) grant PID2020-112495 RB-C21 (funded by MCIN/ AEI /10.13039/501100011033).  
**Data Availability Statement:** The code with the implementation of the trained neural network has been used to predict the energy consumption of a set of buildings in the University of Granada (Spain). The Scala/Spark code and the dataset used in this study are available at [[https://github.com/mcapeltu/PSO_Spark_Scala.git](https://github.com/mcapeltu/PSO_Spark_Scala.git)]([https://github.com/mcapeltu/PSO_Spark_Scala.git](https://github.com/mcapeltu/PSO_Spark_Scala.git)) (accessed on 10 August 2024).  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Name** & **Description** \\ \hline CPU & Intel Core i9-11900, 2.50 GHz, 8 cores \\ GPU & GeForce GTX 1050 Ti, 1392 MHz, 768 CUDA cores, c.c. 6.1, 4196 MiB (VRAM) \\ OS & Ubuntu 20.04 LTS (kernel 5.4) \\ \hline \hline \end{tabular}
\end{table}
Table 11: The hardware and software platforms for the experiments.  
Conflicts of Interest: The authors declare that there are no conflicts of interest regarding the publication of this paper.