# Genetic Algorithm with Radial Basis Mapping Network for the Electricity Consumption Modeling
## 3 Genetic Algorithm with RBM Network
### Updating of the Modified Backpropagation  
The parameters of the modified backpropagation algorithm are updated with Equations (3) and (4), and with \(\beta\) as the momentum constant with a value between 0 and 1. The values considered to find the best values of the hyper-parameters are:  
* The width of the Gaussian mapping \(\sigma\) is in the interval of 0.1-1. * The momentum constant \(\beta\) is in the interval of 0.9-0.99. * \(p_{c}=100\%\). * \(p_{mt}=1\%\). * The population per generation is 60. * The number of generations is 5. * The value of \(k=2\) (k-fold cross-validation). * The number of competitors is 3. We use the methodology described in Figure 4; we create the initial population, for which we propose a solution as a vector with dimension (\(1\times 30\)); to use the genetic algorithm we need a codified solution:  
\[ \begin{array}{cccccccccccccccccccc}1&1&1&1&0&0&0&0&1&1&1&1&0&0&0\\ 0&1&1&1&1&0&0&0&0&1&0&1&1&0&1\end{array} \]  
The first 15 bits represent the solution of the width in the Gaussian mapping \(\sigma\), and the other 15 bits represent the solution of the momentum constant \(\beta\). From the first solution, to create an initial solution, we randomly mix the elements (bits or gens) \(n\) times to find a population of 60 elements shown in Figure 5 of the width in the Gaussian mapping \(\sigma\) and in Figure 6 of the momentum constant \(\beta\), it yields a matrix with dimension (\(60\times 30\)). Figure 5: The first 30 codified solutions of the width in the Gaussian mapping. Once the initial population is created, we find the fathers and the sons, until we find 5 generations. The transcendent part of the algorithm is the evaluation of the chromosomes. Since we find a codified solution, we need to find the decoded solution of the chromosome. To decode the chromosome, we use the next steps:  
1. We find the precision of the chromosome. We scale the chromosome in one searching interval \([l_{\text{min}},\,l_{\text{max}}]\): \[P_{i}=\frac{l_{\text{max}}-l_{\text{min}}}{2^{l}-1}\] (5) with \(l\) as the length of the chromosome, \(l_{\text{max}}\) is the maximum value of the searching set, and \(l_{\text{min}}\) as the minimum value in the searching set. 2. The chromosome \(D\) is decoded as: \[D=\left(\sum_{i=0}^{l-1}2^{i}\right)\times P_{i}+l_{\text{min}}\] (6)  
Since the first 15 bits of the chromosome are the width in the Gaussian mapping \(\sigma\) and the other 15 bits are of the momentum constant \(\beta\), we find two decimal values in the decoded solution of the chromosome. As one example, we take into account the next chromosome to find width in the Gaussian mapping \(\sigma\) and momentum constant \(\beta\). Figure 6: The first 30 codified solutions of the momentum constant. The first 15 bits represent the codified solution of the width in the Gaussian mapping \(\sigma\). We find the precision in the searching interval with \(l_{\min}=0.1\) and \(l_{\max}=1\), and the length of the chromosome is \(l=15\); then equation (5) is evaluated as:  
\[P_{i}=\frac{l_{\max}-l_{\min}}{2^{l}-1}=\frac{1-0.1}{2^{15}-1}=2.7467\times 10^{ -5}\]  
We find the binary solution \(\left(\sum\limits_{i=0}^{l-1}2^{i}\right)\) of (6) as:  
\[\left( \begin{array}{cccccccccccc}1&1&1&1&0&0&0&0&1&1&1&1&0&0&0\\ \end{array} \right)\] \[\Rightarrow\left(\sum\limits_{i=0}^{l-1}2^{i}\right)=2^{14}+2^{13} +2^{12}+2^{11}+2^{6}+2^{5}+2^{4}+2^{3}\] \[\Rightarrow\left(\sum\limits_{i=0}^{l-1}2^{i}\right)=30840\]  
We find the decoded solution of the width in the Gaussian mapping \(\sigma\) as:  
\[\sigma=\left(\sum\limits_{i=0}^{l-1}2^{i}\right)\times P_{i}+l_{ \min}\] \[\Rightarrow\sigma=(30840)(2.7467\times 10^{-5})+0.1\] \[\Rightarrow\sigma=0.94708\]  
The first 15 bits represent the codified solution of the momentum constant \(\beta\).