Skip to content

This project is an attempt to parallelize the Processing Swarm Algorithm

Notifications You must be signed in to change notification settings

jynxmagic/Parallel-Particle-Swarm-Optimization

Repository files navigation

Install:

Windows & Unix

$ python -m pip install -r requirements.txt

$ python -m particle_swarm

Parallel-Particle-Swarm-Optimization

PSO - PSO is a ‘swarm intelligence’ algorithm for real-valued optimization. Real-valued optimization is the process of finding the global optimium (highest or lowest value) of a function which has real (i.e. floating point) inputs. This is used in many real-world applications, such as in engineering where you may have some free parameters to vary when designing something (like an engine part say) and some measure of how good the design is (e.g. efficiency) that you can calculate from those parameters. PSO can then search the (infinite) space of possibilities to find a good solution. There is a good introduction to the algorithm in this video: https://www.youtube.com/watch?v=JhgDMAm-imI. It sounds complicated, but it’s fairly easy to code up – a couple of hundred lines maximum.

Parallel python – PSO is inherently parallel (each particle in the swarm can act independently for large parts of the algorithm). I think it would be good to evaluate a few different parallel frameworks in python for achieving this parallelisation. Mulitprocessing (https://pymotw.com/3/multiprocessing/index.html) and Joblib (https://joblib.readthedocs.io/en/latest/) are the two main contenders (widely used in the machine learning community) and a relatively recent and really interesting framework is Ray (https://ray.io/). Those frameworks handle the parallelisation but within each process the code needs to be running as efficiently as possible, so ‘plain’ python will be too slow. I suggest using numpy (fast array computation library) or possibly numba (just-in-time compilation) to achieve this.

About

This project is an attempt to parallelize the Processing Swarm Algorithm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages