# Neuroevolution for Parameter Adaptation in Differential Evolution
## 2 Materials and Methods
### Differential Evolution
The crossover rate \(Cr\) and scaling factor \(F\) are generated for each crossover and mutation using normal distribution with the mean set to \(\mu_{Cr}\), standard deviation set to 0.1, and Cauchy distribution with location parameter set to \(\mu_{F}\) and scale parameter 0.1. As the sampled values may fall away from the \([0,1]\) interval, they were sampled again until they were inside the boundaries. However, if the sampled \(F>1\), then it was set to \(F=1\). The JADE algorithm also included updating the memory values \(\mu_{Cr}\) and \(\mu_{F}\) depending on the successful values. Further development of JADE resulted in the SHADE (Success-History Adaptive Differential Evolution) algorithm, originally proposed in [32]. SHADE further developed the ideas of JADE by introducing \(H\) memory cells, each containing a pair of \((M_{F,h},M_{Cr,h})\) values, which are used for parameters sampling as follows:  
\[ \begin{cases}F=randc(M_{F,k},0.1)\\ Cr=randn(M_{Cr,k},0.1)\end{cases} , \tag{7}\]where \(randc\) is a Cauchy distributed random value, \(randn\) is a normally distributed random number and \(k\) is chosen from \([1,H]\) for generating each trial vector. At the end of the generation, the successful values of the \(F\) and \(Cr\) parameters were stored in \(S_{F}\) and \(S_{Cr}\), as well as the corresponding goal function improvements \(S_{\Delta f}\), where \(\Delta f_{i}=|f(u_{i})-f(x_{i})|\). The memory cells were updated one by one using the values calculated with weighted Lehmer mean [33]:  
\[mean_{wL}=\frac{\sum_{j=1}^{|S|}w_{j}S_{j}^{2}}{\sum_{j=1}^{|S|}w_{j}S_{j}}, \tag{8}\]  
where \(w_{j}=\frac{S_{\Delta f_{j}}}{\sum_{k=1}^{|S|}S_{\Delta f_{k}}}\), \(S\) is either \(S_{Cr}\) or \(S_{F}\). The Lehmer mean results are further used to set the new \(M_{F}\) and \(M_{Cr}\) values at iteration \(t\) for one of the memory cells \(h\):  
\[ \begin{cases}M_{F,h}^{t+1}=0.5(M_{F,h}^{t}+mean_{(wL,F)})\\ M_{CR,h}^{t+1}=0.5(M_{Cr,h}^{t}+mean_{(wL,Cr)})\end{cases} , \tag{9}\]  
The index of the updated memory cell \(h\) is incremented every generation and is set to 1 once it reaches the number of cells \(H\). The JADE and SHADE algorithms also maintain an external archive of inferior solutions, which is composed of parent vectors replaced during selection. Initially, the archive \(A\) is empty and is filled with solutions until it reaches its predefined maximum size \(NA\). After this, the archive is updated by replacing a randomly chosen individual in the archive with a new one. The archived solutions are used in the current-to-pbest/1 mutation strategy in the \(r2\) index: It is chosen from either the population or the archive. Thus, the archive set allows the diversity of generated trial vectors to be improved. The SHADE algorithm has gained high popularity due to its high efficiency, and has become a basis for a variety of new approaches [34; 35; 36; 37]. After SHADE, the L-SHADE algorithm was developed [38], which included a control technique for the population size \(NP\), one of the three main parameters of DE. The Linear Population Size Reduction (LPSR) method decreases the population size based on current computational resource and removes the worst individuals from the population. The population size is recalculated every generation as follows:  
\[NP_{g+1}=round(\frac{NP_{min}-NP_{max}}{NFE_{max}}NFE+NP_{max}), \tag{10}\]  
where \(NP_{min}=4\) and \(NP_{max}\) are the minimal and initial population sizes, and \(NFE\) and \(NFE_{max}\) are the current and maximal number of function evaluations. Later the modification of the LPSR method was proposed, in which the population size decreases non-linearly (NLPSR) [39]. This approach is inspired by the one applied in the AGSK algorithm [40] and updates the population size as follows:  
\[N_{g+1}=round((N_{min}-N_{max})NFE_{r}^{1-NFE_{r}}+N_{max}), \tag{11}\]  
where \(NFE_{r}=\frac{NFE_{max}}{NFE_{max}}\) is the ratio of the current number of fitness evaluations. The NLPSR approach sets the population size to smaller values compared to the LPSR.