# Predicting the Compressive Strength of Concrete Using an RBF-ANN Model
## 4 The Algorithm for Determining the Centers of RBFs and Their Shape Parameters  
Though there are some advanced algorithms for determining the centers of RBFs and their shape parameters, the stochastic gradient approach presented in the textbook [40] is employed in this study. It was found in [27] that a single-hidden-layer ANN which composes just a few neurons in the hidden layer is sufficient for this application. Therefore, using the stochastic gradient approach is presumed to be enough. Besides, in the author's previous work [41] which was about solving the partial differential equations with the RBFs, the advantages of the stochastic gradient approach were clearly demonstrated.  
Initially, all the values of \(\sigma_{j}\) and \(\zeta_{jk}\), in which \(j=1\sim n\) and \(k=1\sim 7\), are randomly chosen. For the reason that a negative \(\sigma\) is meaningless and too large \(\sigma\) makes the Gaussian RBF behave like a constant, \(\sigma\) is confined just in the range of 0 to 10. Similarly, a too far Euclidean distance from \(\xi\) to \(\zeta_{j}\) is also meaningless, so all the components of \(\zeta_{j}\) are confined in the range from \(-1\) to 2, for the reason that all the components of \(\xi\) are just in the range of 0 to 1. After using Equation (12) to obtain the threshold \(w_{0}\) and the weights \(w_{1}\),..., \(w_{n}\), the error \(e_{i}\) corresponding to the \(i\)th piece of data can be calculated  
\[e_{i}=\hat{\eta}_{i}-\eta_{i} \tag{15}\]  
in which \(\eta_{i}\) is the exact output while \(\hat{\eta}_{i}\) is the predicted output by the RBF-ANN. The total square error is summed up as  
\[E=\sum_{i=1}^{N}e_{i}^{2} \tag{16}\]  
The value of \(E\) is now dependant on values of \(\sigma_{j}\) and \(\zeta_{jk}\). We can use the following formulae to update their values:  
\[\sigma_{j}^{\rm(new)}=\sigma_{j}^{\rm(old)}-\mu\frac{\partial E}{\partial \sigma_{j}} \tag{17}\]  
\[\zeta_{jk}^{\rm(new)}=\zeta_{jk}^{\rm(old)}-\mu\frac{\partial E}{\partial \zeta_{jk}} \tag{18}\]  
in which \(\mu\) is called the stepping parameter. Smaller \(\mu\) results in a steady convergence but might make it trapped in a state of local minimum error. On the other hand, larger \(\mu\) resultsin instability but may help to escape from the strap. In this study, \(\mu\) is set as a relaxation coefficient that varies according to the situation of convergence.  
\[\mu=\left\{\begin{array}{ll}1000\mu^{(p)}&,\ \text{if}\ \mu^{(p)}<0.01\mu^{(i)}\\ 10\mu^{(p)}&,\ \text{else if}\ N_{iter}/200=\text{\it{Int}}(N_{iter}/200)\\ 1.03\mu^{(p)}&,\ \text{else if}\ E<E^{(p)}\\ 0.5\mu^{(p)}&,\ \text{otherwise}\end{array}\right. \tag{19}\]  
in which the superscript (\(p\)) denotes the word \"previous\" and the superscript (\(i\)) denotes the word \"initial\", \(N_{iter}\) represents the number of processed iterations, and the operator \"\(\text{\it{Int}}(\bullet)\)\" means taking the integer part of a floating number. Multiplying \(\mu\) by 1000 or by 10 can help to escape from the state of local minimum error. The initial value of \(\mu\) is 0.01. The training algorithm is listed as follows.  
Step 1: Randomly set initial values for \(\sigma_{j}\) and \(\zeta_{jk}\). (\(j=1\ \sim n\) and \(k=1\ \sim 7\))  
Step 2: Use Equation (12) to obtain the threshold \(w_{0}\) and the weights \(w_{j}\).  
Step 3: Calculate the error \(e_{i}\) for each piece of the training data (\(i=1\ \sim N\)), then sum up the total square error \(E\).  
Step 4: If the total square error \(E\) is the smallest so far, save the values of \(w_{0}\), \(w_{j}\), \(\sigma_{j}\) and \(\zeta_{jk}\) in a file.  
Step 5: If the smallest \(E\) has not been updated for 500,000 times of training iteration, reset \(\sigma_{j}\) and \(\zeta_{jk}\) with random values and go back to Step 2.  
Step 6: Use Equation (19) to set the stepping parameter \(\mu\).  
Step 7: Update all the values of \(\sigma_{j}\) and \(\zeta_{jk}\) by using Equations (17) and (18).  
Step 8: Repeat Steps 2 to 7 and stop when the required number of iterations is achieved.