You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于PAGMO/PYGMO中Corana模拟退火算法参数的技术问询

Understanding PyGMO's simulated_annealing Hyperparameters & Corana Paper Mapping

Hey there! Let's break down PyGMO's simulated annealing parameters, their real-world purpose, how they align with Corana et al.'s classic SA paper, and tailor this to your 4D homography registration problem.

PyGMO Parameter Deep Dive

Let's go through each parameter with your specific problem in mind (4 variables with defined ranges, initial cost ~50, optimal cost ~0):

  • Ts (initial temperature): You’ve got the right idea—this sets the starting threshold for accepting worse solutions via the Metropolis criterion. For your case, since your initial bad solution has a cost of 50, set Ts to match the scale of early cost fluctuations: aim for 20–50. This lets the algorithm explore broadly at first instead of getting stuck in the local minimum of your initial poor guess.
  • Tf (final temperature): This is the "cooled down" temperature where the algorithm stops accepting worse solutions. Since your optimal cost is near 0, set Tf to a tiny value like 1e-3 or 1e-4—low enough that only solutions with negligible cost improvements get accepted, ensuring convergence to the optimal region.
  • n_T_adj (number of temperature adjustments): This controls how many times the temperature is lowered during the annealing process. Each adjustment triggers a cooling step (using a fixed reduction coefficient, more on that later). Think of this as the number of "cooling stages" your algorithm goes through.
  • n_range_adj (number of range adjustments per temperature): For each constant temperature stage, this is how many times the algorithm will tweak the mutation range (step size) of your decision variables. Before each adjustment, it runs a set number of mutations to calculate acceptance rates, then expands or shrinks the range based on whether acceptance is too high (needs more exploration) or too low (needs more exploitation).
  • bin_size (number of mutations for acceptance rate calculation): This is the sample size used to compute acceptance rates before adjusting the mutation range. More iterations mean a more reliable acceptance rate, preventing overreactive step size changes.
  • start_range (initial mutation range): This defines the initial step size for mutating each decision variable. For your problem, since variables have different ranges, ideally you’d set per-dimension values (if PyGMO supports array inputs here):
    • x1 ([-10,10]): 2 (10% of the total range)
    • x2 ([10,30]): 2 (10% of the total range)
    • x3 ([-45,0]): 4.5 (10% of the total range)
    • x4 ([0.5,2]): 0.15 (10% of the total range)
      If you can only use a single float, pick a middle ground like 2 and let the algorithm refine ranges per variable over time.

Mapping to Corana et al.'s Original SA Parameters

Corana’s 1987 paper laid out the core SA framework, and here’s how PyGMO’s parameters map directly:

  • Corana’s N_s: Equivalent to PyGMO’s bin_size. N_s was the number of evaluations per step-size adjustment cycle—PyGMO uses bin_size mutations to compute acceptance rates for the same purpose.
  • Corana’s N_T: Equivalent to PyGMO’s n_range_adj. N_T was the number of step-size adjustments per temperature level, which is exactly what n_range_adj controls in PyGMO.
  • Corana’s r_T: This is the temperature reduction coefficient (e.g., 0.85) that lowers the temperature at each n_T_adj step. PyGMO doesn’t expose this as a direct input—it uses a default value aligned with Corana’s recommendations (usually ~0.85). You can calculate how Ts decays to Tf using Tf = Ts * (r_T)^n_T_adj if you want to fine-tune n_T_adj.
  • Corana’s initial step size: Maps directly to PyGMO’s start_range, the initial mutation amplitude for each variable.

Initial Parameter Recommendations for Your Problem

Based on your 4D homography setup, here’s a starting point for tuning:

  • Ts: 30 (balances early exploration and focus)
  • Tf: 1e-3 (ensures late-stage convergence)
  • n_T_adj: 30 (with r_T=0.85, this takes Ts=30 down to ~1e-3 perfectly)
  • n_range_adj: 7 (enough adjustments per temperature to refine step sizes)
  • bin_size: 150 (reliable acceptance rate stats without wasting computation)
  • start_range: Use per-dimension values if possible, else 2 as a compromise

内容的提问来源于stack exchange,提问作者AstroBen

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 03:48:11