Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
63 views

Lecture 5

The document discusses particle swarm optimization (PSO), an algorithm inspired by swarm behavior in nature. PSO uses a number of agents or particles that constitute a swarm searching for the best solution within a problem space. Each particle tracks its personal best position and is also guided toward the best positions of neighboring particles. The algorithm is presented, including initializing particle positions and velocities randomly and then updating positions and velocities iteratively based on personal and neighborhood best positions until a termination condition is met.

Uploaded by

abdala sabry
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Lecture 5

The document discusses particle swarm optimization (PSO), an algorithm inspired by swarm behavior in nature. PSO uses a number of agents or particles that constitute a swarm searching for the best solution within a problem space. Each particle tracks its personal best position and is also guided toward the best positions of neighboring particles. The algorithm is presented, including initializing particle positions and velocities randomly and then updating positions and velocities iteratively based on personal and neighborhood best positions until a termination condition is met.

Uploaded by

abdala sabry
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

Planning Techniques for Robotics

Mahmoud Abdelaal

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 1


Lecture # 5

Particle Swarm Optimization I

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 2


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 3


Introduction to PSO
Introduction to the PSO: Origins
• Inspired from the nature social behavior and dynamic movements with
communications of insects, birds and fish
• Proposed by James Kennedy & Russell Eberhart (1995)
• Swarm is better than personal

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 4


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 5


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 6


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 7


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 8


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 9


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 10


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 11


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 12


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 13


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 14


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 15


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 16


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 17


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 18


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 19


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 20


Introduction to PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 21


Introduction to PSO
The basic idea
• Each particle is searching for the optimum
• Each particle is moving and hence has a velocity.
• Each particle remembers the position it was in where it had its best result so
far (its personal best)
• But this would not be much good on its own; particles need help in figuring
out where to search.
• The particles in the swarm co-operate. They exchange information about what
they’ve discovered in the places they have visited

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 22


Introduction to PSO
The Concept of PSO
• Uses a number of agents (particles) that constitute a swarm moving around in
the search space looking for the best solution
• Each particle in search space adjusts its “flying” according to its own flying
experience as well as the flying experience of other particles

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 23


Introduction to PSO
The Concept of PSO
The idea is similar to bird flocks searching for food.
• Bird = a particle,
• Food = a solution
• pbest = the best solution (fitness) a particle has achieved so far.
• gbest = the global best solution of all particles within the swarm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 24


Introduction to PSO
The Concept of PSO
• Each particle modifies its position according to:
• its current position
• its current velocity
• the distance between its current position and pbest
• the distance between its current position and gbest

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 25


Introduction to PSO
The Concept of PSO
• Collection of flying particles (swarm) - Changing solutions
• Search area - Possible solutions
• Movement towards a promising area to get the global optimum
• Each particle keeps track:
• its best solution, personal best, pbest
• the best value of any particle, global best, gbest

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 26


Introduction to PSO
PSO Search Scheme
• The basic concept of PSO lies in accelerating each particle toward its pbest
and the gbest locations, with a random weighted acceleration at each time.
• PSO uses a number of agents (particles), that constitute a swarm flying in the
search space looking for the best solution.
• Each particle is treated as a point (candidate solution) in a space which
adjusts its “flying” according to its own flying experience as well as the
flying experience of other particles.
• The neighborhood concept in PSO is not the same as the one used in other
meta-heuristics search, since in PSO each particle’s neighborhood never
changes (is fixed)

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 27


Mathematical Model of PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 28


Mathematical Model of PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 29


Mathematical Model of PSO

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 30


Mathematical Model of PSO
Each particle tries to modify its position X using the following formula:

X (t+1) = X(t) + V(t+1) (1)


V(t+1) = wV(t) + c1 ×rand ( ) × ( Xpbest - X(t)) + c2 ×rand ( ) × ( Xgbest - X(t)) (2)

V(t) velocity of the particle at time t


X(t) Particle position at time t
w Inertia weight
c1 , c2 learning factor or accelerating factor (Constants)
rand uniformly distributed random number between 0
and 1
Xpbest particle’s best position
Xgbest global best position

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 31


Mathematical Model of PSO
PSO Algorithm - Parameters

• Number of particles usually between 10 and 50


• C1 is the importance of personal best value
• C2 is the importance of neighborhood best value
• Usually C1 + C2 = 4 (empirically chosen value)
• If velocity is too low → algorithm too slow
• If velocity is too high → algorithm too unstable

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 32


Mathematical Model of PSO
• Particle’s velocity:

1. Inertia • Makes the particle move in the same


direction and with the same velocity

2. Personal • Improves the individual


• Makes the particle return to a previous
Influence
position, better than the current

3. Social • Makes the particle follow the best


Influence neighbors direction

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 33


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 34


PSO Algorithm
PSO Algorithm
1) Create a ‘population’ of agents (particles) uniformly distributed over X
2) Evaluate each particle’s position according to the objective function
3) If a particle’s current position is better than its previous best position,
update it
4) Determine the best particle (according to the particle’s previous best
positions)
5) Update particles’ velocities:
6) Move particles to their new positions:
7) Go to step 2 until stopping criteria are satisfied

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 35


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 36


PSO Algorithm
The PSO algorithm pseudocode as following:
Input: Randomly initialized position and velocity of Particles:
Xi (0) andVi (0)
Output: Position of the approximate global minimum X*

1: while terminating condition is not reached do


2: for i = 1 to number of particles do
3: Calculate the fitness function f
4: Update personal best and global best of each particle
5: Update velocity of the particle using Equation 2
6: Update the position of the particle using equation 1
7: end for
8: end while

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 37


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 38


PSO Algorithm
• Simulation 1

max
y

min
fitness

x
search space

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 39


PSO Algorithm
• Simulation 2

max
y

min
fitness

x
search space

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 40


PSO Algorithm
• Simulation 3

max
y

min
fitness

x
search space

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 41


PSO Algorithm
• Simulation 4

max
y

min
fitness

x
search space

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 42


PSO Algorithm
• Simulation 5

max
y

min
fitness

x
search space

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 43


PSO Algorithm
• Simulation 6

max
y

min
fitness

x
search space

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 44


PSO Algorithm
• Simulation 7

max
y

min
fitness

x
search space

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 45


PSO Algorithm
• Simulation 8

max
y

min
fitness

x
search space

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 46


PSO Algorithm
• Search result

Iteration Swarm best


0 416.245599
5 515.748796
10 759.404006
15 793.732019
20 834.813763
100 837.911535
5000 837.965771
Global 837.9658

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 47


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 48


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 49


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 50


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 51


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 52


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 53


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 54


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 55


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 56


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 57


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 58


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 59


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 60


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 61


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 62


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 63


PSO Algorithm

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 64


PSO Algorithm
Algorithm Characteristics
Advantages
• Insensitive to scaling of design variables
• Simple implementation
• Easily parallelized for concurrent processing
• Derivative free
• Very few algorithm parameters
• Very efficient global search algorithm
Disadvantages
• Tendency to a fast and premature convergence in mid optimum points
• Slow convergence in refined search stage (weak local search ability)

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 65


Thank you for your attention !

Good Luck !

Mahmoud Abdelaal Planning Techniques for Robotics_@_BFCAI 66

You might also like