# Construction Project Cost Prediction Method Based on Improved BiLSTM
## 4 Hyperparametric Optimisation Methods
### Phase Adjustment of Inertia Weights and Learning Factors  
In traditional PSO algorithms, inertia weights and learning factors are typically set to fixed values, which limits global optimisation capability and convergence speed. Reference [33] dynamically adjusted inertia weights and learning factors according to changes in fitness, [34] dynamically adjusted inertia weights according to the number of iterations, and [35] dynamically adjusted the learning factor according to the number of iterations. These schemes all resulted in significant improvements in algorithm performance. However, considering the different states of particles in different periods, it is difficult to maximise PSO performance based on a single factor. Therefore, we combine the number of iterationsand degree of adaptability and propose adjusting the inertia weights and learning factors in stages according to the following formulas:  
\[w=w_{min}+(w_{max}-w_{min})*\left(\frac{f_{i,t}-f_{best}}{f_{i,t}}\right)^{m} \tag{19}\]  
\[c_{1}=c_{1,min}+(c_{1,max}-c_{1,min})*\left(\frac{f_{i,t}-f_{best}}{f_{i,t}} \right)^{m} \tag{20}\]  
\[c_{2}=c_{1,min}+(c_{1,max}-c_{1}) \tag{21}\]  
\[m=\frac{t^{2}}{T^{2}} \tag{22}\]  
where \(w_{max}\) and \(w_{min}\) are the maximum and minimum values of the inertia weight \(w\), respectively; \(f_{i,t}\) and \(f_{best}\) are the fitness value of particle \(i\) and the value of globally optimal particle fitness in iteration \(t\), respectively; \(c_{1,max}\) and \(c_{1,min}\) denote the maximum and minimum values of the individual learning factor \(c_{1}\), respectively; \(c_{2}\) denotes the social learning factor; and \(t\) and \(T\) denote the current iteration and a maximum number of iterations, respectively. Additionally, \(w\in[0.4,0.9]\) and \(c_{1}\in[1,4]\).  
Stage regulation divides the iterative process of the algorithm into three phases.  
1. Exploration phase: at the beginning of the iteration, when the value of \(m\) is small, the inertia weights and learning factors are relatively less affected by adaptation, which reduces the magnitude of changes in the weight and learning factors, thereby ensuring that the particles have larger inertia weights and stronger individual learning abilities, promoting global exploration and escape from local optima.
2. Equilibrium phase: in the middle of the iteration, when the value of \(m\) is moderate, the inertia weights and learning factors become smoother through adaptation, which improves the social learning ability of the particles and helps them better utilise collective experiences for refined searching and adjustment.
3. Convergence phase: in later iterations, when the value of \(m\) is large, the inertia weights and learning factors are more sensitive to the influence of adaptation, which enhances the social cognitive ability of the particles, accelerates the convergence of the algorithm and helps guide particles to converge to the globally optimal solution more quickly.  
As the value of \(m\) varies in the interval \([0,1]\), it enables constraining the particles while adjusting their behavior, enabling them to strike a balance between exploration and convergence and thereby optimising the performance of the algorithm.