Skip to main content

A swarm intelligence optimization library for simple, rapid construction of improved strategies

Project description

jiangpy

A swarm intelligence optimization library with 120+ algorithms and a pluggable strategy system.

Design: Algorithm = Base Optimizer + Pluggable Strategies

Installation

pip install jiangpy

For visualization support:

pip install jiangpy[visualize]

Quick Start

import numpy as np
from jiangpy import FloatVar, PSO, HillClimbing, LatinHypercube

def objective(x):
    return np.sum(x ** 2)

problem = {
    "bounds": FloatVar(lb=-10.0, ub=10.0, n_dims=30),
    "minmax": "min",
    "obj_func": objective,
}

model = PSO(pop_size=50, epoch=500)
model.with_init(LatinHypercube())
model.with_local_search(HillClimbing(step_size=0.01))
result = model.solve(problem)
print(f"Best fitness: {result.target.fitness}")

Features

  • 120+ optimization algorithms across swarm, evolutionary, physics, math, bio, and human-inspired categories
  • Pluggable strategies for initialization, selection, crossover, mutation, local search, and replacement
  • Parallel evaluation support (single / thread / process)
  • Multi-objective optimization via weighted sum
  • Benchmark functions including classical and CEC benchmarks
  • Hyperparameter tuning via grid search

Documentation

Run the examples:

python -m jiangpy.examples_usage

Requirements

  • Python >= 3.8
  • numpy >= 1.20.0
  • matplotlib >= 3.3.0 (optional, for visualization)

License

MIT

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

jiangpy-0.1.0.tar.gz (12.3 MB view details)

Uploaded Source

Built Distribution

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

jiangpy-0.1.0-py3-none-any.whl (13.1 MB view details)

Uploaded Python 3

File details

Details for the file jiangpy-0.1.0.tar.gz.

File metadata

  • Download URL: jiangpy-0.1.0.tar.gz
  • Upload date:
  • Size: 12.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for jiangpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c0458b7c526b19f289e7dc21b2aa3ce6a8569ea679c64f129c4d6fdccf5b39d7
MD5 96548de53131fe4ec05a4e4f11d57ada
BLAKE2b-256 ca078f0c9530e1e44972f52880cc70aa21bcd7030f0dd65749fa4eac66178cd4

See more details on using hashes here.

File details

Details for the file jiangpy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jiangpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for jiangpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9529192943a12f86bb58c46db22fbd3063050c2e0a77780f6ace73d9e2c5183
MD5 2f2abbf52f112131c4f48543ba4c799b
BLAKE2b-256 3e05a1914e0595c15a217cdeebde46a7b1a408c4f1843add06e06652cc80c05a

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