Running Particle Swarm Optimization (PSO)
This guide covers how to set up, run, and analyze results for Particle Swarm Optimization (PSO) experiments in EvOC.
What is Particle Swarm Optimization (PSO)?
Particle Swarm Optimization (PSO) is a population-based optimization technique inspired by the social behavior of bird flocking or fish schooling. Instead of using genetic operators like crossover and mutation, PSO particles "fly" through the search space, adjusting their trajectories based on their own best-known position and the swarm's overall best-known position. EvOC provides a graphical interface to configure and visualize this process.
Configuring and Running PSO
Follow these steps to set up and execute your PSO algorithm:
Select Algorithm Type:
- From the main EvOC Dashboard, click on the
Particle Swarm Optimization (PSO)
option.
- From the main EvOC Dashboard, click on the
Configure PSO Parameters:
- PSO involves setting parameters related to the particles and their movement. Use the EvOC interface to configure:
- Algorithm Strategy (A standard PSO implementation is provided).
- Optimization Objective (Maximize/Minimize Weights).
- Number of Dimensions for the problem space.
- Particle Constraints: Minimum/Maximum position and speed values.
- Inertia Weights / Coefficients: Parameters controlling the influence of particle history and swarm knowledge (e.g., cognitive
phi1
, socialphi2
). - Evaluation Function: The function defining the "landscape" the particles are exploring.
- Population (Swarm) Size and Number of Generations (Iterations).
Parameter Guidance
Use the tooltips within the EvOC interface for detailed explanations of each PSO parameter. The specific values depend on the nature of the evaluation function being optimized.
- PSO involves setting parameters related to the particles and their movement. Use the EvOC interface to configure:
Execute the Algorithm:
- After setting all parameters, click the
Execute Algorithm
button to start the optimization process.
- After setting all parameters, click the
Understanding and Using Your PSO Results
When the PSO run completes, the results interface will provide insights:
Best Position & Fitness
- Review the Best Individual Fitness section to find the best fitness value achieved by any particle during the run.
- EvOC will also typically show the coordinates (Best Individual Position) corresponding to that best fitness value.
PSO Visualization (Animation)
A key feature for PSO is an animation or plot showing the particle swarm's movement over generations/iterations. Observe how the particles converge towards promising areas of the search space. The red dot indicates the current global best position found by the swarm.
Sharing Your Run
Use the
Share Run
button to share this specific PSO experiment with colleagues or collaborators who also use EvOC.Enter their registered email addresses (comma-separated) in the pop-up.
Viewing and Downloading Logs
Click
Show Logs
to see generation-by-generation details, such as the global best fitness found at each step.Use the
Download Logs
button within this view to save the data (.txt
) for further analysis.
Viewing the Generated Code
Click
Show Code
to inspect the underlying Python code (using libraries like DEAP) for the configured PSO run.Leverage the
Ask EvOC AI to Explain
feature for code clarifications.
Accessing Run History
- Your complete history of runs, including PSO experiments, can be accessed via the
View Previous Runs
orView All Runs
section on the EvOC platform.
Next Steps:
- Learn about Running a Traditional EA
- Explore configuring Genetic Programming (GP)
- See how to use EA for ML Tuning