liveBook · Manning

Particle

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

A particle is a candidate agent in particle swarm optimization whose position and movement encode a possible solution.

A particle is a candidate solution in particle swarm optimization. Its position encodes parameters such as shot velocity and angle, while its speed determines how the position changes during an update. section 4.2.1

A particle’s practical lifecycle includes:

  • Generate its starting position within configured bounds and assign an initial speed. section 4.2.1
  • Evaluate its fitness against the target objective and retain its own best position. section 4.2.1
  • Adjust speed toward personal and swarm-wide best positions, clamp speed, and add it to the position. section 4.2.1

Cannon-shot parameters

Treat each particle as a guess for the velocity and angle needed to shoot a cannonball to a selected distance. Repeated evaluation and movement move the swarm toward better guesses. section 4.2.1

Listing 4.8 EDL_4_2_PSO.ipynb: Generating a particle
def generate(size, pmin, pmax, smin, smax):
  part = creator.Particle(np.random.uniform(pmin, 
   pmax, size))                                    #1
 
  part.speed = np.random.uniform(smin, smax, size)   #2
  part.smin = smin
  part.smax = smax
  return part

Inspect the minimal generator that creates a particle array, initializes its speed, and records speed bounds. section 4.2.1

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Explains generation, fitness evaluation, personal and global bests, speed limits, and position updates through executable functions.
Examples
Uses cannon-shot velocity and angle, target distance, swarm scatter plots, and DEAP notebook listings.
What you can do after
Apply it via DEAP by generating, evaluating, updating, and inspecting candidate solutions in a swarm.
How it connects
Connects particles to particle swarm optimization, fitness, velocity, position, personal best, and global best.

Also explained in

Compare how 2 books explain particle →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.