liveBook · Manning

Velocity clamping

As explained in Optimization Algorithms: AI techniques for design, planning, and control problems

Velocity clamping is a particle-swarm constraint that limits each particle’s velocity to a specified minimum and maximum.

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

How Optimization Algorithms: AI techniques for design, planning, and control problems covers it

How deep it goes
Defines boundary replacement and motivation, then demonstrates a PySwarms parameter without deriving clamp-selection heuristics.
Examples
Uses PySwarms neural-network training and its two-entry velocity-clamp tuple as the concrete implementation example.
What it assumes
Assumes particle swarm optimization terminology, particle velocities, inertia, and cognitive and social update components.
What you can do after
Apply it via PySwarms by setting minimum and maximum velocity limits for a PSO experiment.
How it connects
Connects velocity clamping with particle swarm optimization, inertia weight, exploration, exploitation, and neural network training.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Optimization Algorithms: AI techniques for design, planning, and control problems. The section links point to the parts of the book it draws on.