# Self-Tuning Lam Annealing: Learning Hyperparameters While Problem Solving
## 2 Methods
### Self-Tuning Lam
#### 2.3.5 Putting It All Together
For the two

Figure 6: Trap problem: Self-Tuning Lam, Modified Lam, and target acceptance rates for (**a**) 1000 iterations, (**b**) 10,000 iterations, (**c**) 100,000 iterations, and (**d**) 1 million iterations. longest run lengths, all 100 runs of both algorithms got caught in the trap, converging to the local optimum with cost 512. The same is nearly true for the runs of length 10,000, where some runs of the Self-Tuning Lam were still attempting to escape the trap (e.g., the average cost in that case was just above 512). Although the shortest runs saw an average cost for the Modified Lam lower than that of the Self-Tuning Lam at a statistically significant level, neither algorithm escaped the trap in any runs. ### Continuous Optimization Results

We now consider continuous function optimization, utilizing function optimization problems that have been used in other experimental studies [40; 41]. Additionally, we define a variation of each enabling scaling the function so that we can demonstrate that the Self-Tuning Lam's behavior is robust to cost scale. We consider several run lengths. For each combination of problem, run length, and algorithm, we average 100 runs. We use Gaussian mutation [42], where a real value \(x\) is mutated into \(x^{\prime}\) via:

\[x^{\prime}=x+N(0,\sigma), \tag{32}\]

where \(N(0,\sigma)\) is a normally distributed random variable with mean 0 and standard deviation \(\sigma\). We use \(\sigma=0.05\). The reason for such a small \(\sigma\) is the domain of the functions we are optimizing. For example, \(x\in[0.0,1.0]\) for two of them. #### 3.2.1 One Global Minimum, One Local Minimum, and Inflexion Point

We first use a pair of functions from [PERSON] et al. [40], both of which are minimization problems, so unlike the discrete optimization experiments, no transformation is necessary. Both define \(x\in[0.0,1.0]\). The first function that we must minimize is:

\[f_{1}(x)=(6x-2)^{2}\sin(12x-4), \tag{33}\]

The second problem is defined in terms of the first, where we must minimize:

\[f_{2}(x)=0.5f_{1}(x)+10(x-0.5)+5. \tag{34}\]

Both functions are characterized by a global minimum, a sub-optimal local minimum, and an inflexion point, as seen in Figure 7. \begin{table}
\begin{tabular}{c c c c} \hline \hline \(N\) & **Modified Lam** & **Self-Tuning Lam** & **T-Test \(p\)-Value** \\ \hline
1000 & 539.63 & 683.63 & \(<\)10\({}^{-65}\) \\
10,000 & 512.00 & 512.43 & 0.04 \\
100,000 & 512.00 & 512.00 & n/a \\
1,000,000 & 512.00 & 512.00 & n/a \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Average solution cost for the Trap problem. The global minimum for \(f_{1}\) occurs at \(x\approx 0.75725\), and is \(f_{1}(x)\approx-6.02074\). The local minimum occurs at \(x\approx 0.14259\), which leads to \(f_{1}(x)\approx-0.98633\). Similarly, the global minimum for \(f_{2}\) occurs at \(x\approx 0.09239\), and is \(f_{2}(x)\approx 0.665095\). The local minimum occurs at \(x\approx 0.73650\), which leads to \(f_{2}(x)\approx 4.46227\). However, we add a scale parameter to each to enable exploring the impact of function scale on the behavior of the Self-Tuning Lam and Modified Lam annealing schedules. Therefore, we consider the following functions (for \(\phi\in\{1,10,100,1000\}\)):

\[f_{1,\phi}(x)=\phi(6x-2)^{2}\sin(12x-4), \tag{35}\]

and

\[f_{2,\phi}(x)=\phi(0.5f_{1}(x)+10(x-0.5)+5)



1 million iteration runs, as both algorithms consistently optimally or near optimally solve the problem at that run length. However, the solutions found by the Self-Tuning Lam are already near-optimal for the 100,000 iteration runs, while the Modified Lam solutions are still significantly off at that run length. The Self-Tuning Lam optimally solves the problem an order of magnitude faster than the Modified Lam. We attribute this to the Self-Tuning Lam's ability to more consistently follow its target Lam acceptance rate, independent of function scale, as seen in Figures 8-11, and independent of run length (e.g., parts (a) to (d) of each figure that follows).