# SmartFog: Training the Fog for the Energy-Saving Analytics of Smart-Meter Data
## 6 Numerical Performance of the Proposed SmartFog
The corresponding soft-margin parameter \(C\) was optimized by a grid search algorithm over the set: \(C\in\left\{10^{-3},10^{-2},\ldots,10^{6},10^{7}\right\}\), selecting the best value of \(C=100\). The accuracy obtained by the tested SVM is detailed in Table 3. This table puts in evidence that the SVM produces a worse accuracy than the 3L-SDAE architecture of about 5%. _Comparative energy performance_-- Passing to consider the energy consumption of the underlying SmartFog execution platform of Figure 1, we carried out several tests by varying the strategy for the mapping of the hidden layers of SDAE of Figure 2 onto the available Fog-Cloud computing nodes of Figure 1. For this purpose, three mapping strategies were implemented and numerically tested. The first one relies on the proposed AEGA of Algorithm 1. The second one implements a _Non-Adaptive_ Elitist GA (NA-EGA), that is obtained by removing from the pseudo-code of Algorithm 1 both the \"if\" \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Input L.** & **First L.** & **Second L.** & **Third L.** & **Fourth L.** & **Fifth L.** \\ \hline \multicolumn{5}{c}{**3L-SDAE–3 Hidden Layers**} \\ \hline
60 & 30 & 20 & 10 & — & — \\
120 & 60 & 40 & 20 & — & — \\
240 & 120 & 80 & 40 & — & — \\
360 & 180 & 120 & 60 & — & — \\ \hline \multicolumn{5}{c}{**5L-SDAE–5 Hidden Layers**} \\ \hline
60 & 40 & 30 & 20 & 10 & 5 \\
120 & 80 & 60 & 40 & 20 & 10 \\
240 & 160 & 120 & 80 & 40 & 20 \\
360 & 240 & 180 & 120 & 60 & 30 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Per-layer hidden units in the tested 3L-SDAE and 5L-SDAE architectures. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Time Window [h]** & **\# Inputs** & **Accuracy 3L-SDAE** & **Accuracy 5L-SDAE** \\ \hline
1 & 60 & 0.854 & 0.792 \\
2 & 120 & 0.926 & 0.884 \\
4 & 240 & 0.869 & 0.801 \\
6 & 360 & 0.795 & 0.725 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Tested classification accuracy of the 3L-SDAE and 5L-SDAE architectures. \begin{table}
\begin{tabular}{c c} \hline \hline
**Time Window [h]** & **Accuracy** \\ \hline
1 & 0.826 \\
2 & 0.885 \\
4 & 0.811 \\
6 & 0.808 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Classification accuracy for the benchmark SVM classifier. statements at lines #12 and #16. The last strategy is the simplest one and maps all the hidden layers of the considered SDAE of Figure 2 to the Cloud node of Figure 1 for their training. In this last case, no energy consumption can be obtained since the entire algorithm is running on the unique Cloud node. In all performed tests, the size \(S_{POP}\) of the populations of the simulated GAs is held constant, equal to 10, the only-Cloud solution is included in the initial populations and a maximum of \(I_{GEN}=30\) iterations are run. Furthermore, the (numerically optimized) hyper-parameters \(TH_{LOW}\), \(TH_{UPP}\) and \(r\) used for the simulation of the proposed AEGA of Algorithm 1 are set to 0.1, 1.1 and 0.85 respectively, while, in the simulated NA-EGA, the (numerically optimized) sizes \(S_{ELIT}\) and \(S_{CHA}\) of the elite and crossed over-plus-mutated sub-lists are fixed to 4 and 6, respectively. In the following, the optimized inter-threshold interval will be denoted as \(\mathcal{T}_{0}\). According to Figure 1, the simulated SmartFog platform is composed of five Fog nodes and a single Cloud node, with each node being equipped with a corresponding virtual clone [9]. The computing and network capacities of each Fog clone are randomly selected over the sets: 5-12 Mbit/s for the processing rates of CPUs, 5-10 Mbit/s for the SM-to-Fog transmission rates and 10-20 Mbit/s for the intra-Fog and the Fog-Cloud transmission rates. However, the computing and network capacities of the Cloud clone are fixed to their respective maximum values (i.e., 12, 10 and 20 Mbit/s, respectively), in order to reflect the more stable and larger resources made available by the Cloud. Furthermore, the simulated inter-node network topology is meshed, with inter-Fog and Fog-Cloud links that are bidirectional and symmetric.