About
Gradient-Free-Optimizers is a Python library providing 23 gradient-free optimization algorithms with a unified interface for black-box function optimization.
About Gradient-Free-Optimizers
Gradient-Free-Optimizers (GFO) provides a collection of optimization algorithms designed for problems where gradients are unavailable or impractical to compute. It serves as the optimization backend for Hyperactive and can also be used standalone for custom optimization tasks.
Mission
GFO aims to make gradient-free optimization accessible and practical. By providing a unified interface across 23 algorithms, it reduces the complexity of choosing and switching between optimization methods. The library prioritizes simplicity, transparency, and reliability.
Key Features
23 Optimization Algorithms: From simple hill climbing to advanced Bayesian optimization, organized into local, global, population, and sequential model-based categories.
Unified Interface: All algorithms share the same API. Switch algorithms by changing one line of code.
Mixed Search Spaces: Define continuous ranges, discrete grids, categorical choices, and optional SciPy distribution-backed dimensions in a single dictionary.
Constraint Support: Define constraints as simple Python functions. Invalid positions are automatically avoided during search.
Memory System: Built-in caching prevents redundant evaluations. Critical for expensive objective functions like ML model training.
Production Ready: Extensive test coverage across Python 3.10-3.14, NumPy 1.x/2.x, and all major operating systems.
Design Philosophy
Simplicity First: Common tasks should be straightforward. Define your search space, choose an optimizer, and run.
Transparent Behavior: No hidden state or implicit configuration. All algorithm parameters have sensible defaults but can be adjusted.
Interchangeable Algorithms: The unified interface makes it easy to experiment with different optimizers.
Low Dependency Surface: Core library only requires NumPy and pandas. Progress bars, SciPy distribution dimensions, and sklearn-based surrogate models have opt-in dependencies.
When to Use GFO
Use Gradient-Free-Optimizers when:
You need fine-grained control over the optimization process
You’re optimizing custom objective functions (not just ML models)
You want minimal dependencies and a lightweight library
You’re building tools that need an optimization backend
Use Hyperactive instead when:
You need parallel optimization across multiple CPU cores
You want experiment tracking and result comparison
You’re primarily tuning ML models (sklearn, PyTorch, etc.)
You need integration with other optimization frameworks (Optuna, sklearn)
Community & Support
Issues: Report bugs or request features
Discussions: Ask questions
How to Cite
If you use Gradient-Free-Optimizers in your research, please see Citation for citation information.