Frequently Asked Questions
General
What makes GFO different from other optimization libraries?
GFO focuses on simplicity and transparency:
Search spaces are Python dictionaries with tuples, arrays, lists, or optional SciPy distributions
All 23 algorithms share the same interface
Small core dependency surface
Serves as the backend for Hyperactive
When should I use GFO vs. Hyperactive?
Use GFO when you need fine-grained control over optimization
Use Hyperactive for higher-level features like parallel optimization, experiment tracking, and ML framework integrations
Does GFO support parallel optimization?
GFO itself runs single-threaded. For parallel optimization, use Hyperactive which builds on GFO and adds multi-process support.
Algorithms
Which optimizer should I start with?
For quick exploration:
RandomSearchOptimizerFor smooth functions:
HillClimbingOptimizerFor expensive evaluations:
BayesianOptimizerWhen unsure:
SimulatedAnnealingOptimizer(good general-purpose)
My optimizer gets stuck in local optima. What should I do?
Try these approaches:
Use
SimulatedAnnealingOptimizerwith highstart_tempUse population-based methods like
ParticleSwarmOptimizerIncrease
rand_rest_pto add random restartsUse
RandomRestartHillClimbingOptimizer
How many iterations do I need?
It depends on:
Search space size (more dimensions = more iterations)
Function complexity (more local optima = more iterations)
Algorithm choice (SMBO needs fewer iterations for expensive functions)
Rule of thumb: Start with 100-500 iterations and increase if needed.
Search Spaces
How do I define a log-scale search space?
Use np.logspace:
search_space = {
"learning_rate": np.logspace(-4, -1, 30), # 0.0001 to 0.1
}
Can I use categorical parameters?
Yes, use a NumPy array of strings:
search_space = {
"optimizer": np.array(["adam", "sgd", "rmsprop"]),
}
How do I handle conditional parameters?
GFO doesn’t have native conditional support. Options:
Include all parameters and handle unused ones in your objective
Use constraints to enforce valid combinations
Performance
Why is my optimization slow?
Check these factors:
Objective function: The optimizer is rarely the bottleneck
Memory: Disable with
memory=Falseif not neededSMBO overhead: GP training is O(n^3); use Forest for many iterations
Search space size: Coarser grids are faster
How can I speed up SMBO optimizers?
Use
ForestOptimizerinstead ofBayesianOptimizerfor 100+ iterationsReduce candidate sampling for Lipschitz/DIRECT
Consider using simpler algorithms for cheap objective functions
Troubleshooting
I get NaN or Inf scores. What’s happening?
GFO handles invalid scores gracefully. Check:
Your objective function for numerical issues
Parameter combinations that cause errors
Consider using constraints to avoid invalid regions
The optimizer doesn’t find the optimal value I expect.
Possible causes:
Not enough iterations
Search space doesn’t include the optimum
Using the wrong optimizer for the problem type
For minimization: check
optimum="minimum"or negate the score
Where is the documentation for older versions?
Documentation for previous versions of GFO is available at the Legacy Documentation (v1.x).
How do I make results reproducible?
Set the random seed:
opt = HillClimbingOptimizer(search_space, random_state=42)