# SmartFog: Training the Fog for the Energy-Saving Analytics of Smart-Meter Data
## 6 Numerical Performance of the Proposed SmartFog
Since we consider here the 3L-SDAE, we need to allocate \(L=3\) hidden layers over the available computing (i.e., Fog-plus-Cloud) nodes. The resulting energy plots are reported in Figure 3. Each simulated point was obtained by averaging over 30 independent runs of randomly generated computing and network capacities of the (aforementioned) five Fog nodes that compose the simulated SmartFog platform. Specifically, in Figure 3, the continuous black (resp., dashed blue) curve plots the simulated average energy consumption of the proposed AEGA of Algorithm 1 under the optimized inter-threshold \(\mathcal{T}_{0}=[0.1,\,1.1]\) (resp., the benchmark NA-EGA), while the point marked by the red diamond reports the average energy consumption of the (aforementioned) only-Cloud solution that uses only the Cloud node for the training of the implemented 3L-SDAE. An examination of the energy plots of Figure 3 leads to three main insights. First, being of elitist type, both the proposed AEGA and benchmark NA-EGA converge to the same final energy value by following non-increasing trajectories. However, the convergence time (in multiple of the generated populations) of the proposed AEGA (resp., benchmark NA-EGA) is around 16 (resp., 27), so that the convergence of the AEGA is about 1.7 times faster than the corresponding one of the benchmark NA-EGA. Second, the behavior of the energy curve of the AEGA is step-like (see the cliffs at the iteration indexes 3, 6 and 16 in Figure 3), while the corresponding behavior of the NA-EGA is smoother. We have numerically ascertained that the step-like behavior of the energy plot of the AEGA is induced, indeed, by the adaptive mechanism implemented by the \"if\" statements at lines #12 and #16 of Algorithm 1, which allows the AEGA to quickly escape already explored regions of the underlying objective function and to fast enter still unexplored attraction basins of new local/global minima. Third, the gap between the energy consumption of the only-Cloud solution (i.e., the red diamond in Figure 3) and the steady-state one of the proposed AEGA is noticeable (e.g., around 30%) and it is approached by the AEGA after several iterations limited up to 16 (see the continuous curve of Figure 3). _Sensitivity on the threshold setting_--In this paragraph, we consider the impact of the setting of the two hyper-parameters \(TH_{LOW}\) and \(TH_{UPP}\) on the average energy consumption of the proposed SmartFog platform. Specifically, we performed the tests by using the following two additional inter-threshold intervals \(\mathcal{T}_{1}=[0.3,\,0.6]\) and \(\mathcal{T}_{2}=[0.05,\,2.0]\), respectively, while the hyper-parameter \(r\) was set to the previous value of 0.85. The average energy consumption of the proposed AEGA of Algorithm 1 under the inter-threshold intervals \(\mathcal{T}_{1}\) and \(\mathcal{T}_{2}\) is shown by the dotted dark green curve and the dash-dotted magenta curve of Figure 3, respectively. Interestingly enough, we can observe from the dotted dark green curve of Figure 3 that when the more stressed inter-threshold interval \(\mathcal{T}_{1}\) is used, the proposed AEGA converges to the same final energy value of the optimized interval \(\mathcal{T}_{0}\). However, the convergence time is very different from the previous one. Since, in fact, the threshold are more restrictive, the proposed AEGA shows a fast transitory behavior, but after a few iterations the convergence becomes flat (the thresholds are too restrictive and more iterations are needed) and the time period for obtaining the final solution is stretched. The total convergence time is around 20 iterations.