🐝
Swarm Intelligence
56 nature-inspired algorithms including PSO, ACO, and more
120+ optimization algorithms for numeric problems
from opt.swarm_intelligence import ParticleSwarm
from opt.benchmark.functions import shifted_ackley
# Create optimizer
optimizer = ParticleSwarm(
func=shifted_ackley,
lower_bound=-12.768,
upper_bound=12.768,
dim=2,
max_iter=100
)
# Run optimization
best_solution, best_fitness = optimizer.search()
print(f"Best fitness: {best_fitness:.6f}")Particle Swarm, Ant Colony, Firefly, Bat, Grey Wolf, Whale Optimization, and 50+ more nature-inspired algorithms.
Genetic Algorithm, Differential Evolution, CMA-ES, Cultural Algorithm, and Imperialist Competitive Algorithm.
SGD, Adam, AdamW, RMSprop, Adagrad, Adadelta, AMSGrad, and Nesterov Accelerated Gradient.
BFGS, L-BFGS, Nelder-Mead, Powell, Simulated Annealing, Hill Climbing, and Trust Region methods.
pip install git+https://github.com/Anselmoo/useful-optimizeruv add git+https://github.com/Anselmoo/useful-optimizer