Velocity clamping limits every particle’s velocity to specified minimum and maximum values during particle swarm optimization. If an updated velocity exceeds either boundary, it is replaced by that boundary value. This prevents particles from wandering too far through the problem space or becoming stuck in a region. section 9.5.1
The constraint is especially useful when inertia causes velocities to grow. With inertia greater than one, velocities can escalate and drive the swarm toward divergence; clamping bounds that movement while the swarm searches. section 9.5.1
Apply velocity clamping by:
- Choose a minimum and maximum velocity for the particles. section 9.5.1
- Calculate each particle’s new velocity using the usual PSO update. section 9.5.1
- Replace values above the maximum with the maximum, and values below the minimum with the minimum. section 9.5.1
- Inspect whether the resulting limits preserve useful exploration without allowing excessive wandering. section 9.5.1
Applying a clamp in PySwarms
During PSO-based neural-network training, experiment with the algorithm parameters and enable PySwarms velocity clamping. The velocity-clamp parameter is a two-entry tuple: the first entry sets the minimum velocity and the second sets the maximum velocity. section 9.7
Figure 9.11 Effect of PSO parameters on the search behavior. Large inertia promotes exploration, and small values promote exploitation. c1 > c2 results in excessive wandering of individuals through the search space. In contrast, c2 > c1 may lead particles to rush prematurely toward a local optimum.
Compare how inertia and the cognitive and social components shape exploration, exploitation, wandering, and premature movement toward local optima. section 9.5.1
