## 3 Development of an HS-ANN Hybrid Model
### Step 3. Improvise a new harmony from the HM  
A new harmony vector, \(\mathbf{x}^{\prime}=\left(x_{1}^{\prime},\ x_{2}^{\prime},\...,\ x_{N}^{\prime}\right)\), is created from the HM based on assigned HMCR, PAR, and randomization. For example, the value of the first decision variable \(\left(x_{1}^{\prime}\right)\) for the new vector can be selected from any value in the designated HM range, \(x_{1}^{1}\sim x_{1}^{\text{HMS}}\). In the same way, the values of other decision variables can be selected. The HMCR parameter, which varies between 0 and 1, is a possibility that the new value is selected from the HM as follows:  
\[x_{i}^{\prime}\leftarrow\left\{ \begin{array}{ll}x_{i}^{\prime}\in\left\{x_ {1}^{1},\ x_{1}^{2},\...,\ x_{i}^{\text{HMS}}\right\}&\text{with probability of HMCR}\\ x_{i}^{\prime}\in\mathbf{X}_{i}&\text{with probability of }(1-\text{HMCR}), \end{array} \right. \tag{12}\]  
The HMCR is the probability of selecting one value from the historic values stored in the HM, and the value (1-HMCR) is the probability of randomly taking one value from the possible range of values. This procedure is analogous to the mutation operator in genetic algorithms. For instance, if a HMCR is 0.95, the HS algorithm would pick the decision variable value from the HM including historically stored values with a 95% of probability. Otherwise, with a 5% of probability, it takes the value from the entire possible range. A low memory considering rate selects only a few of the best harmonies, and it may converge too slowly. If this rate is near 1, most of the pitches in the harmony memory are used, and other ones are not exploited well, which does not lead to good solutions. Therefore, typically HMCR \(=0.7-0.95\) is recommended. On the other hand, the HS algorithm would examine every component of the new harmony vector, \(\mathbf{x}^{\prime}=\left(x_{1}^{\prime},\ x_{2}^{\prime},\...,\ x_{N}^{\prime}\right)\), to decide whether it has to be pitch-adjusted or not. In this procedure, the PAR parameter which sets the probability of adjustment for the pitch from the HM is used as follows:  
\[\text{Pitch adjusting decision for }x_{i}^{\prime}\leftarrow\left\{ \begin{array}{ll} \text{Yes}&\text{with probability of PAR}\\ \text{No}&\text{with probability of }(1-\text{PAR}).\end{array} \right. \tag{13}\]  
The pitch adjusting procedure is conducted only after a value is selected from the HM. The value (1\(-\)PAR) is the probability of doing nothing. To be specific, if the value of PAR is 0.1, the algorithm will take a neighboring value with 0.1 \(\times\) HMCR probability. For example, if the decision for \(x_{i}^{\prime}\) in the pitch adjustment process is Yes, and \(x_{i}^{\prime}\) is considered to be \(x_{i}(k)\), then the \(k\)th element in \(\mathbf{X}_{i}\), or the pitch-adjusted value of \(x_{i}(k)\), is changed into  
\[ \begin{array}{ll}x_{i}^{\prime}\gets x_{i}(k+m)&\text{for discrete decision variables}\\ x_{i}^{\prime}\gets x_{i}^{\prime}+\alpha&\text{for continuous decision variables},\end{array}  \tag{14}\]  
where \(m\) is the neighboring index, \(m\in\left\{\...,\ -2,\ -1,\ 1,\ 2,\...\right\}\), \(\alpha\) is the value of \(bw\times u(-1,1)\), \(bw\) is an arbitrarily chosen distance bandwidth or fret width for the continuous variable, and \(u(-1,1)\) is a random number from uniform distribution with the range of \([-1,1]\). If the pitch-adjusting rate is very low, because of the limitation in the exploration of a small subspace of the whole search space, it slows down the convergence of HS. On the contrary, if the rate is very high, it may cause the solution to scatter around some potential optima. Therefore, PAR \(=0.1-0.5\) is used in most applications. The parameters HMCR and PAR help the HS algorithm to search globally and locally, respectively, to improve the solution. _Step 4. Evaluate new harmony and update the HM_  
This step is to evaluate the new harmony and update the HM if necessary.