Mathematics in Machine Learning - Particle Swarm Optimization (PSO) (2): Particle Swarm Optimization with Inertial Weights

In order to improve the convergence performance of the basic particle swarm algorithm, Shi and Eberhart introduced inertial weights in their paper titled "A modified particle swarm optimizer" published at the 1998 IEEE International Conference on Evolutionary Computing, and gradually everyone defaulted to this improved particle. The swarm algorithm is the standard particle swarm algorithm.

It can be seen from the speed formula of the basic particle swarm algorithm that the item on the right includes three parts: the first part is the speed before the particle; the second part and the third part are the adjustment of the particle to the speed. Without the latter two parts, the particle will keep the same speed and fly in one direction until it reaches the boundary, so the particle is likely to find no optimal solution, excluding the optimal solution on the trajectory of the particle flight, but this situation is very difficult. Less. Furthermore, without the first part, the flight speed of the particles would be determined only by their current position and the historical best position, and the speed itself is memoryless. Assume that the initial particle iii is in the best position, then the flying speed of the particle will be 0, i.e. it will remain stationary until other particles find a better speed than particleiiThe position of i is even better than the optimal solution, thus replacing the global optimal. At this point, each particle will fly to the weight center of its own best position and the group's global best position. So it is conceivable that without the first part, the search space of particle swarm optimization will shrink with evolution. At this time, only when the global optimum is in the initial search interval, the particle swarm algorithm can find the solution. So the final solution is very dependent on the initial population. When there is no first part, this algorithm is more like a local optimal algorithm.

For different problems, the trade-off between local optimal ability and global optimal ability is different. Consider this question. Combined with the above analysis, Shi and Eberhart added an inertia weight to the velocity update formula, namely:
vidk + 1 = wvidk + c 1 r 1 ( pid − zidk ) + c 2 v 2 ( pgd − zidk ) v_{id} ^{k+1}=wv_{id}^k+c_1r_1(p_{id}-z_{id}^k)+c_2v_2(p_{gd}-z_{id}^k)vidk+1=wvidk+c1r1(pidwithidk)+c2v2(pgdwithidk)

The position update formula is the same as that of the particle swarm algorithm. inertia weight www plays the role of weighing the local optimal ability and the global optimal ability. The figure below shows how the particle adjusts its position:
Location update schematic
figure,zkz^kwithk is the current search point,zk + 1 z^{k+1}withk + 1 is the adjusted search point,vkv^kvk is the current speed,vk + 1 v^{k+1}vk + 1 is the adjusted speed,v pbest v_{\text{pbest}}vpbestpbestis the speed based on v gbest v_{\text{gbest}}vgbestis based on gbestthe speed.

In order to observe the influence of this inertia weight on the performance of particle swarm optimization, Shi and Eberhart applied this algorithm to Schaffer's f6 function, because this function is a well-known benchmark function for evaluating optimization algorithms. They change the size of the inertia weight, and this function is a well-known benchmark function for evaluating optimization algorithms. They changed the size of the inertia weight and got some conclusions through a lot of experiments. When the inertia weight is small (<0.8), if the particle swarm algorithm can find the global optimum, then the search time it experiences is very short, that is, all particles tend to converge quickly. If the optimal solution is in the initial search space, the particle swarm algorithm will easily find the global optimum, otherwise it will not find the optimum. When the inertia weight is large (>1.2), the particle swarm algorithm is more like a global search method, and it always searches new regions. Of course, the particle swarm optimization at this time will require more iterations to reach the global optimum, and it is more likely that the global optimum cannot be found. When the inertia weight is moderate, the particle swarm algorithm will have a greater chance of finding the global optimum, but the number of iterations will also be more than in the first case.

According to these analyses, instead of setting the inertia weight as a fixed value, they set it as a function that decreases linearly with time. The function form of the inertia weight is usually:
w = wmax − wmax − wmin iter max ⁡ × kw=w_{max }-\frac{w_{max}-w_{min}}{\text{iter}_{\max}}\times kw=wmaxitermaxwmaxwm i n×k

In the above formula, wmax w_{max}wmaxis the initial weight, wmin w_{min}wm i nis the final weight, iter max ⁡ \text{iter}_{\max}itermaxis the maximum number of iterations, kkk is the current iteration number.

This function makes the particle swarm algorithm tend to excavate at the beginning, and then gradually turn to excavation, thereby adjusting the solution in the local area. These improvements have greatly improved the performance of particle swarm optimization.

Guess you like

Origin blog.csdn.net/hy592070616/article/details/123771857