Skip to content

Release v.0.2.0

Compare
Choose a tag to compare
@ljvmiranda921 ljvmiranda921 released this 11 Jun 01:15
· 212 commits to master since this release
bfc16c2

Release notes

  • NEW: pyswarms.backend module for custom swarm algorithms. Users can now use some primitives provided in this module to write their own optimization loop, providing a more "white-box" approach in swarm intelligence - #119, #115, #116, #117
  • IMPROVED: Unit tests ported to pytest. We're now dropping the unittest module. Pytest's parameterized tests enable our test cases to scale much better - #114
  • IMPROVED: Python 2.7 support is dropped. Given the imminent end-of-life of Python 2, we'll be fully-supporting Python 3.4 and above - #113
  • IMPROVED: PSO algorithms ported to the new PySwarms backend - #115
  • IMPROVED: Updated documentation in ReadTheDocs and new Jupyter notebook example - #124

The PySwarms Backend module

The new backend module exposes some swarm optimization primitives so that users can create their custom swarm implementations without relying too much on our base classes. There are two main components for the backend, the Swarm class and the Topology base class. Using these classes, you can construct your own optimization loop like the one below:

optimization_loop

The Swarm class

This class acts as a data class that holds all necessary attributes in a given swarm. The idea is to continually update the attributes located there. You can easily initialize this class by providing the initial position and velocity matrices.

The Topology class

The topology class abstracts away common operations in swarm optimization: (1) determining the best particle in the swarm, (2) computing the next position, and (3) computing the velocity matrix. As of now, we only have the Ring and Star topologies implemented. Hopefully, we can add more in the future.

pyswarms_api