SpotOptim provides sophisticated fallback strategies for handling acquisition function failures during optimization. This ensures robust optimization even when the surrogate model struggles to suggest new points.
15.1 What is Acquisition Failure?
During surrogate-based optimization, the acquisition function suggests new points to evaluate. However, sometimes the suggested point is too close to existing points (within tolerance_x distance), which would provide little new information. When this happens, SpotOptim uses a fallback strategy to propose an alternative point.
15.2 Fallback Strategies
SpotOptim uses a fallback strategy to propose an alternative point. The acquisition_failure_strategy parameter controls this behavior, defaulting to "random".
15.2.1 Random Space-Filling Design (Default)
Strategy name: "random"
This strategy uses Latin Hypercube Sampling (LHS) to generate a new space-filling point. LHS ensures good coverage of the search space by dividing each dimension into equal-probability intervals.
When to use:
General-purpose optimization
When you want simplicity and good space-filling properties
The acquisition failure handling is integrated into the optimization process:
Acquisition optimization: SpotOptim uses differential evolution to optimize the acquisition function
Distance check: The proposed point is checked against existing points using tolerance_x
Fallback activation: If the point is too close, _handle_acquisition_failure() is called
Strategy execution: The configured fallback strategy generates a new point
Evaluation: The fallback point is evaluated and added to the dataset
15.4 Advanced Usage: Setting Tolerance
The tolerance_x parameter controls when the fallback strategy is triggered. A larger tolerance means points need to be farther apart, triggering the fallback more often:
def simple_objective(X):"""Simple quadratic function for demonstration"""return np.sum(X**2, axis=1)bounds_demo = [(-5, 5), (-5, 5)]# Strict tolerance (smaller value) - fewer fallbacksoptimizer_strict = SpotOptim( fun=simple_objective, bounds=bounds_demo, tolerance_x=1e-6, # Very small - almost never triggers fallback max_iter=20, seed=42)# Relaxed tolerance (larger value) - more fallbacksoptimizer_relaxed = SpotOptim( fun=simple_objective, bounds=bounds_demo, tolerance_x=0.5, # Larger - triggers fallback more often max_iter=20, seed=42)print(f"Strict tolerance setup complete")print(f"Relaxed tolerance setup complete")
TensorBoard logging disabled
Optimizer with verbose mode created
15.5.2 2. Adjust Tolerance Based on Problem Scale
For problems with small search spaces, use smaller tolerance:
def scale_objective(X):return np.sum(X**2, axis=1)# Small search spaceoptimizer_small = SpotOptim( fun=scale_objective, bounds=[(-1, 1), (-1, 1)], tolerance_x=0.01, # Small tolerance for small space max_iter=20, seed=42)# Large search spaceoptimizer_large = SpotOptim( fun=scale_objective, bounds=[(-100, 100), (-100, 100)], tolerance_x=1.0, # Larger tolerance for large space max_iter=20, seed=42)print(f"Small space optimizer created (bounds: [-1, 1])")print(f"Large space optimizer created (bounds: [-100, 100])")
Small space optimizer created (bounds: [-1, 1])
Large space optimizer created (bounds: [-100, 100])
15.6 Technical Details
15.6.1 Random Strategy Implementation
The fallback strategy:
Generates a single point using Latin Hypercube Sampling
Ensures the point is within bounds
Applies variable type repairs (rounding for int/factor variables)
This is computationally efficient while maintaining good space-filling properties.
15.7 Summary
Strategy: SpotOptim uses a random space-filling strategy (LHS) when acquisition fails.
Trigger: Activated when acquisition-proposed point is too close to existing points (within tolerance_x)
Monitoring: Enable verbose=True to see when fallbacks occur