# Knowledge-Based Perturbation LaF-CMA-ES for Multimodal Optimization
## 2 Materials and Methods
### Cma-Es  
The CMA-ES algorithm, proposed by [PERSON] & Ostermeier in 1996 ([PERSON], 1996), is one of the most advanced algorithms for solving continuous optimization problems. In CMA-ES, a multivariate Gaussian distribution model is hypothesized to describe the previous motion pattern of the problem in the search space. During the iterative process, relevant parameters such as the covariance matrix and step size are adjusted based on historical information. New individuals are generated through sampling from the adjusted distribution, and the best individuals are selected to update the parameters. The CMA-ES is invariant to translation and rotation. Therefore, CMA-ES is invariant to translation and rotation, making it highly effective for solving ill-conditioned and complex problems.  
The CMA-ES algorithm consists of four main processes: sampling, selection, recombination, and parameter updating. The most common CMA-ES is (\(\mu\), \(\lambda\))-CMA-ES, where \(\mu\) and \(\lambda\) are the numbers of parent and child populations, respectively. In the \(g+1\) generation of the iterative process of (\(\mu\), \(\lambda\))-CMA-ES, \(\lambda\) individuals are generated by sampling: \(\mathrm{X}_{k}^{(g+1)}\sim m^{g}+\sigma^{g}N(0,C^{g}),k=1,2,\ldots,\lambda\), where \(m^{g}\) is the mean value of individuals after population selection of \(g\) generation; \(\sigma^{g}\) is the standard deviation of \(g\) generation, also known as step size; \(C^{g}\) is the covariance matrix and \(N(0,C^{g})\) is the multivariate normal distribution with the mean value of \(0\) and covariance matrix of \(C^{g}\).  
Individuals are selected according to their fitness value. The first \(\mu\) individuals are selected as parents to enter the recombination process. In the process of recombination, \(m^{(g+1)}\) is updated as \(m^{(g+1)}=\sum_{i=1}^{\mu}\omega_{i}\cdot x_{i:\lambda}^{(g+1)}\), where \(\omega_{i}\) is the weight coefficient of reorganization, \(x_{i:\lambda}^{(g+1)}\) denotes the \(i\)-th best individual among the \(\lambda\) individuals of the \(g+1\) generation.  
\[f\Big{(}x_{1:\lambda}^{(g+1)}\Big{)}\leq f\Big{(}x_{2:\lambda}^{(g+1)}\Big{)} \leq\cdots\leq f\Big{(}x_{\lambda:\lambda}^{(g+1)}\Big{)} \tag{4}\]  
where \(f(x)\) is the fitness of the individual \(x\).  
Finally, the parameters of \(\sigma^{g}\) and \(C^{g}\) are updated. The step size \(\sigma\) is updated according to the evolution path. The evolution path \(p_{\sigma}\) is updated by a distribution that obeys \(N(0,I)\) according to the deviation of the mean value as shown in the following formula.  
\[p_{\sigma}^{(g+1)}=(1-c_{\sigma})p_{\sigma}^{(g)}+\sqrt{c_{\sigma}(2-c_{ \sigma})\mu_{eff}}C^{(g)-\frac{1}{2}}\frac{m^{(g+1)}-m^{(g)}}{\sigma^{(g)}} \tag{5}\]  
where, \(c_{\delta}\) is the learning rate of the cumulative evolutionary path and \(\mu_{eff}\) is the variance effective selection quality.  
\[\ln\sigma^{(g+1)}=\ln\sigma^{(g)}+\frac{c_{\sigma}}{d_{\sigma}\cdot E\| \mathcal{N}(0,I)\|} \tag{6}\]  
where \(d_{\sigma}\) is the attenuation coefficient and \(E\|\mathcal{N}(0,I)\|\) is the expectation of the Euclidean norm of a vector of \(\mathcal{N}(0,I)\) distribution.  
The update of the covariance matrix \(C\) is the core part of the CMA-ES algorithm. \(C\) is updated with the following formula.  
\[C^{(g+1)}=\big{(}1-c_{1}-c_{\mu}\big{)}C^{(g)}+c_{1}\bigg{(}p_{c}^{(g+1)}\Big{(} p_{c}^{(g+1)}\Big{)}^{T}\bigg{)}+c_{\mu}\sum_{i=1}^{\mu}\omega_{i}y_{i: \lambda}^{(g+1)}\Big{(}y_{i:\lambda}^{(g+1)}\Big{)}^{T} \tag{7}\]  
where \(c_{1}\) and \(c_{\mu}\) are the learning rates of the rank \(1\) and rank \(\mu\) update of the covariance matrix, respectively, and \(p_{c}^{(g+1)}\) is an evolutionary path similar to \(p_{c}^{(g+1)}\).  
\[y_{i:\lambda}^{(g+1)}=\frac{x_{i:\lambda}^{(g+1)}-m^{(g)}}{\sigma^{(g)}} \tag{8}\]\[p_{c}^{(g+1)}=(1-c_{c})p_{c}^{(g)}+\sqrt{c_{c}(2-c_{c})\mu_{eff}}\frac{m^{(g+1)}-m ^{(g)}}{\sigma^{(g)}} \tag{9}\]