-
Notifications
You must be signed in to change notification settings - Fork 0
Optimizer Parameters
Every parameter accepted by Minimization.optimize(), Maximization.optimize(), and MultiObjective.optimize() is documented here, with guidance on how to choose values.
result = Minimization(space, objective).optimize(
# Core HS parameters
memory_size = 20,
hmcr = 0.85,
par = 0.35,
max_iter = 5000,
bw_max = 0.05,
bw_min = 0.001,
# Resume / checkpoint
resume = "auto",
checkpoint_path = None,
checkpoint_every = 500,
# Evaluation cache
use_cache = False,
cache_maxsize = 4096,
# CSV logging
log_init = False,
init_log_path = None,
log_history = False,
history_log_path = None,
history_every = 1,
log_evaluations = False,
eval_log_path = None,
# Output
verbose = False,
callback = None,
)MultiObjective additionally accepts archive_size.
Harmony Memory Size (HMS) — the number of candidate solutions kept in memory.
- Larger values → more diversity, slower convergence
- Smaller values → faster but may miss global optimum
- Typical range: 10–50
- Guideline: use 20–30 for most problems; increase to 50+ for high-dimensional spaces (> 20 variables)
Harmony Memory Considering Rate — probability of drawing a value from memory rather than sampling randomly.
- Range: (0, 1)
- Higher HMCR → more exploitation of known good solutions
- Lower HMCR → more random exploration
- Typical range: 0.70–0.95
- Guideline: 0.85 works well for most problems. Lower to 0.70 if the algorithm gets stuck early.
Pitch Adjusting Rate — given that a value was drawn from memory, probability of applying a small perturbation (pitch adjustment) rather than using the value as-is.
- Range: (0, 1)
- Higher PAR → more local search around memory values
- Lower PAR → more exact memory recall
- Typical range: 0.25–0.50
- Guideline: 0.35 is a robust default. Increase to 0.45 for continuous problems, decrease to 0.20 for heavily discrete/categorical spaces.
Total number of improvisation steps.
-
Guideline: start with 2000–5000. Monitor the history plot — if fitness is still decreasing at
max_iter, increase it. - For expensive objectives (FEM, CFD): use
use_cache=Trueand a larger budget.
Initial bandwidth for continuous pitch adjustment, as a fraction of domain width.
At iteration 0, Continuous.neighbor() uses a Gaussian step of σ = bw_max × (hi − lo).
- Default 0.05 means ±5% of domain width at the start
- Guideline: 0.05–0.20 for most problems. Increase for wide domains where large jumps are needed early.
Only affects Continuous variables. Discrete, Integer, and Categorical variables ignore bandwidth.
Final bandwidth — the step size decays exponentially from bw_max to bw_min over max_iter iterations.
- Default 0.001 means ±0.1% of domain width at the end
- Set
bw_min == bw_maxfor constant bandwidth (original HS behavior) -
Guideline:
bw_minshould be small enough for the desired solution precision. For structural problems requiring mm-precision, 0.001 is usually sufficient.
Decay formula:
bw(t) = bw_max × exp(−ln(bw_max/bw_min) × t / max_iter)
Controls whether to continue from an existing checkpoint or start fresh.
| Value | Behavior |
|---|---|
"auto" |
Resume if checkpoint exists and is non-empty, else start fresh. Safe default for long runs. |
"new" |
Always start fresh. Existing checkpoint is overwritten. Use when you want a clean run. |
"resume" |
Always resume. Raises FileNotFoundError if checkpoint not found. Use to enforce continuity. |
For expensive objectives, always enable use_cache=True.