Skip to main content

No project description provided

Project description

SLPso - Social Learning Particle Swarm Optimization

License Python 3.10

SLPso is a Python library that implements the Social Learning Particle Swarm Optimization (SL-PSO) algorithm for scalable optimization problems.

About the Algorithm

This library used this article as a basis:

A Social Learning Particle Swarm Optimization Algorithm for Scalable Optimization Authors: Ran Cheng and Yaochu Jin Journal: Information Sciences, Volume 291, Pages 43-60, Year 2015 DOI: 10.1016/j.ins.2014.08.039 URL to the Paper: Read the full paper

If you use the SLPso library in your research, please consider citing this library.

Reveal quote

SLPso - Social Learning Particle Swarm Optimization [Software]. (2023). Available at: https://github.com/vsg-root/slpso.

About SL-PSO

The Social Learning Particle Swarm Optimization is a population-based optimization algorithm inspired by the behavior of a swarm of particles. It leverages social interactions to enhance exploration of the search space and convergence to optimal solutions in scalable optimization problems.

Important Note

It is crucial to highlight that this library's performance did not match the results reported in the referenced paper. The following results were obtained through extensive experiments, each run 30 times for different dimensions, with 100 particles, and a total of 200,000 fitness evaluations for each experiment.

Status

SLPso has not been published on PyPI yet. The library is currently under active development and is available directly in the GitHub repository. You can install it using pip directly from GitHub, as shown in the installation instructions below.

Installation

To get started with SLPso, you can install it via pip:

pip install slpso

Try your first SL-PSO program

>>> import numpy as np
>>> from slpso.slpso import SLPSO

>>> def custom_objective_function(positions: np.ndarray) -> np.ndarray:
    """
    The custom objective function to be minimized.

    Args:
        positions (np.ndarray): An array of particle positions.

    Returns:
        np.ndarray: An array of fitness values.
    """
>>>     return np.sum(positions ** 2, axis=1)

>>> lower_bound = -30.0  # Set the lower bound
>>> upper_bound = 30.0   # Set the upper bound

>>> slpso_optimizer = SLPSO(custom_objective_function,
                            seed=1,
                            lower_bound=lower_bound,
                            upper_bound=upper_bound,
                            show_progress=False)

>>> global_best_position, global_best_value = slpso_optimizer.optimize()
>>> print("Global Best Position:", global_best_position)
>>> print("Global Best Value:", global_best_value)

Note: This library is not affiliated with or endorsed by the original researchers. It is an independent implementation of the SL-PSO algorithm for the convenience of users interested in applying it to their optimization problems. Please do not confuse this library with the work of the original authors.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slpso-0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slpso-0.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file slpso-0.1.1.tar.gz.

File metadata

  • Download URL: slpso-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.9 Linux/6.2.6-76060206-generic

File hashes

Hashes for slpso-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9222c1192ebe40a534580d64adf8742f77f4d7e3a855af806fdc97534f7906aa
MD5 a9b734b09f8492a883e0acdccc260846
BLAKE2b-256 2e07901361619d6973376e1465fba1fe4cba763a5c8ee240f74b976772234686

See more details on using hashes here.

File details

Details for the file slpso-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: slpso-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.9 Linux/6.2.6-76060206-generic

File hashes

Hashes for slpso-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ec3a5720da6fc62dd62055a3ade50a8ae7444a798878bb56097db3d68d177f5
MD5 aeab87b4265ca16d6725380926c4d6d2
BLAKE2b-256 3e8ed8a7eea5963a9b146c44395ebd4876346ea1428cb8a9e7d5cbab929870be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page