Keywords: tune4

Bayesian Heuristic Approach

# Bayesian Heuristic Approach to Automated Parameter Tuning, Investigation of Examples

Jonas Mockus

Institute of Mathematics and Informatics,
Akademijos 4, LT-2600 Vilnius, Lithuania
`jmockus@gmail.com`

Abstract

Results of complexity theory show the limitations of exact analysis. That explains popularity of heuristic algorithms. It is well known that efficiency of heuristics depends on the parameters. Thus we need some automatic procedures for tuning the heuristics. That helps comparing results of different heuristics. This enhance their efficiency, too.

In this paper the theory and applications of Bayesian Heuristic Approach are discussed. Examples of the Bayesian approach to automated tuning of heuristics are investigated.

All the algorithms are implemented as platform independent Java applets or servlets. Readers can easily verify and apply the results for studies and for real life optimization models.

The information is on the main web-site:
and four mirrors.

Optimization, Bayesian, Tuning Heuristics, Distance Studies

# Introduction

The efficiency of metaheuristics depends on parameters. Often this relation is defined by statistical simulation and have many local minima. Therefore methods of stochastic global optimization are needed to optimize the parameters.

The traditional numerical analysis considers optimization algorithms that guarantee some accuracy for all functions to be optimized. This includes the exact algorithms. Limiting the maximal error requires a computational effort that often increases exponentially with the size of the problem [1].

An alternative is the average analysis where the expected error is made as small as possible [2]. The average is taken over a set of functions to be optimized. The average analysis is called the Bayesian Approach (BA) [3,4]. Application of BA to optimization of heuristics is called the Bayesian Heuristic Approach (BHA) [5].

In the examples of this paper distances from the global minimum are not known. Thus the efficiency of methods is tested by comparing with average results of the "pure" Monte Carlo. Monte Carlo converges and does not depend on parameters that can be adjusted to a given problem by using some expert knowledge or additional test runs.

Possibilities of application are illustrated by several examples. designed for distance graduate studies in the Internet environment. All the algorithms are implemented as platform independent Java applets or servlets therefore readers can easily verify and apply the results for studies and for real life heuristic optimization problems.

# Bayesian Approach (BA)

Tuning of heuristics is regarded as an optimization problem. We are looking for such parameters of heuristics that provide best results. Denote the original function to be optimized as . We know just that this function belongs to some family of functions. Thus we cannot define the optimization quality by just a single sample . All the family have to be regarded. Assume that search time is limited and defined as the number of iterations.

Denote by ( ) the results obtained applying times a heuristic to a function . Here and , where is the final decision of heuristics after iterations. Formally heuristic after iteration transforms the original function into another function . Here belongs to a family of functions transformed by heuristics . Transformed function shows how the value of the original function obtained applying times the heuristic depends on the heuristic parameters .

Denote results of -th iteration as . Here and . Using the same heuristics parameter we obtain different results depending on which sample function optimize. Thus here is optimization under uncertainty. In the optimization under uncertainty two different approaches are widely used:
the Min-Max and the Bayesian.

The Min-Max approach minimizes the maximal deviation from the solution. Here the worst case is regarded. The Bayesian approach searches for minimal expected deviation. Thus the average case is investigated. If the family is a small set of well defined functions then the Min-Max approach is efficient. Otherwise we regard the average case because the worst case is too bad.

Applying the Bayesian approach we fix a prior distribution on a set of functions . We need that defining average results. A prior distribution is transformed into a posterior distribution on a subset of the family of . We can do that by conditional probabilities.

|  |  | (1)

Here shows how the probability of event depends on calculation results .

Now we can define a risk function . The risk function shows how the expected deviation from the solution depends on parameters . Here , where is the optimal and is a current values of heuristic parameters. Owing to linearity of deviation the risk function can be expressed as the difference . The second component is a constant associated with the set and a prior distribution . We see that does not depend on the decisions therefore we disregard this component. Then we can define the risk function as the expected value of

|  |  | (2)

The Bayesian Approach (BA) is defined by fixing a prior distribution on a set of functions and by minimizing the risk function [6,7,3,8,9]. The risk function shows how the average deviation depends on parameters . The distribution is regarded as a stochastic model of , where may be a deterministic or a stochastic function. This is possible because using Bayesian approach uncertain deterministic functions can be regarded as some stochastic functions [10,6,11,12,13]. That is essential feature of the Bayesian approach in this setup. For example, if several values of some deterministic function are known then the level of uncertainty can be represented as the conditional standard deviation of the corresponding stochastic function where is a stochastic variable. The aim of BA is to provide as small average deviation as possible.

# Software Framework for Global Optimization (GMJ)

In optimization problems theory and software are interconnected. The final results depend on the mathematical theory of optimization and the software implementation. Thus we have to regard them both.

## Bayesian Search, "Bayes"

Representing different examples as a part of some general set-up we need basic theoretical and software tools. The examples should be united by some common framework. We call that GMJ (Global Minimizer by Java). The Bayesian Heuristic Approach is a proper theoretical concept. We apply this approach both for automatic tuning of heuristic parameters and for search of optimal mixtures of heuristics.

That is just an initial part of the GMJ. Important is to make GMJ open for development by users. Users contribute their own optimization methods in addition to the Bayesian ones. User optimization models are included as GMJ tasks. The results of optimization are represented by GMJ analysis objects. A minimal set of methods, tasks, and analysis objects is implemented by default. The rest depends on users.

## Monte Carlo, Uniform Search, "Mig1"

Often the calculation of deviation from the exact global minimum is as difficult as the original global optimization problem. We can define some by using additional properties of the objective function, such as Lipshitz constant.
Otherwise a different standard should be defined. The uniform Monte Carlo search can be used:

|  |  | (3)

Here components are generated randomly by uniform distribution on the feasible intervals

Monte Carlo is apparently the simplest method providing convergence with probability one for any continuous objective function. Thus we can test efficiency of global optimization methods by comparing them with Monte Carlo search (3).
The analysis tool of GMJ "Convergence" defines how the best values of objective functions depend on iteration number. A method of search can be classified as efficient only if it converges faster than Monte Carlo.

## Convergence

The 'Convergence' window of GMJ shows how the best value of the objective depends on the number of iterations, For most methods that is a decreasing step-function. Steps happen at 'improving' iterations. In global optimization the convergence line often is nearly logarithmic. That illustrates the high complexity of global optimization, in general.

## Projection

The 'Projection' window of GMJ is apparently the simplest two-dimensional visualization of multi-dimensional objective functions. Using the Projection we may obtain some useful information about the objective if the variables are changed separately. The method 'Exkor' does just that.

Other optimization methods change many variables at each iteration. Here the 'Projection' shows how the density of observations depends on variables . In efficient methods the density is higher around the global minimum.
Comparing "Projection" of different methods we see higher densities around global minima in both Bayesian methods "Exkor" and "Bayes".

The illustration are projections of the Exkor and Bayes methods in Fig. 1. and Fig. 2.

# Improving Expert Heuristics

The main objective of BHA is improving any given heuristic by defining the best parameters and the best ``mixtures'' of different heuristics. The examples indicate that heuristic decision rules mixed and adapted by BHA often outperform the best individual heuristics. In addition, BHA provides almost sure convergence. However, the final results of BHA depend on the quality of the specific heuristics including the expert knowledge. Therefore the BHA should be regarded as a tool for enhancing the heuristics but not for replacing them.

Many well known optimization algorithms, such as Genetic Algorithms [14], GRASP [15], and Tabu Search [16], may be regarded as metaheuristics that can be improved using BHA.

Genetic Algorithms [14] is an important "source" of useful stochastic search heuristics. It is well known that the results of the genetic algorithms depend on the mutation and cross-over parameters. The Bayesian Heuristic Approach could be used in optimizing those parameters.

In tabu search the issues of identifying best combinations of short and long term memory and best balances of intensification and diversification strategies can be obtained using BHA.

Hence, the Bayesian Heuristics Approach can be applied to improve various stochastic or heuristic algorithms of discrete optimization. The proved convergence of a discrete search method is an asset. If not, then the convergence conditions are provided by tuning the BHA parameters [17].

# Optimization of Mixed Heuristics

## Greedy Heuristics

Greedy heuristics build a system from scratch. The well known greedy heuristic is the specific value of object . The greedy heuristic algorithm: "take the greatest feasible ", is very fast but it may get stuck in some non-optimal decision.

We remove the heuristic algorithm out of such non-optimal decisions by taking decision with probability where is an increasing function of and is a parameter vector. The BA is to optimize the parameters by minimizing the best result obtained applying times the randomized heuristic algorithm .

Optimization of adapts the heuristic algorithm to a given problem. Let us illustrate the parametrization of by three randomization functions: Here the upper index denotes the Monte Carlo component (randomization by the uniform distribution). The index defines the linear component of randomization. The index denotes the pure heuristics with no randomization: if , and , otherwise. Here parameters define the probabilities of using randomization . The optimal may be applied solving different but related problems, too [17]. That is important in the "on-line" optimization.

## Cut Optimization, "Cut"

This is a simple example of a typical task using the Bayesian Approach for tuning heuristics. The two-dimensional "Guillotine" cut is regarded. The 'mixture' of three 'greedy" heuristics is optimized. The term 'Greedy' describes heuristics that build system from scratch by adding elements one-by-one. The 'mixture' means that different heuristics are selected randomly at each iteration by some fixed probabilities.

The first heuristic is denoted as "Random". Here we select cut elements with equal probabilities. The second heuristic is 'Max Size First'. The third heuristic is 'Min Size First'. The names speaks for themselves. We search for the best mixture of these three heuristics at fixed optimization time. The time parameter is important because the optimal mixture depends on the number of iterations.

A sample of optimization of a two-dimensional "guillotine" cut problem are in Fig. 3. Numbers show how many times the corresopnding heuristic is used.
A sample of optimization of a three-dimensional packing problems is in Fig. 4.

## Permutation Heuristics

Permutation heuristics are to improve some initial expert decision. Here the expert knowledge is involved in the initial decision. Applying BHA for global minimization different permutations of some feasible solution are tested. Heuristics are defined as the difference between the permuted and the original solutions.

# Optimization of Simulated Annealing (SA)

A good example is optimization of profiled school schedule model. The vector objective is evaluated by linear scalarization. The relative importance of various factors are defined by the school authorities. The initial schedule is provided by the school and is improved by permutations.

Permutations are made by trying to close the gaps between lectures. The best obtained schedule is recorded after each iteration. Changes to worse schedules are made with some probabilities. That is for improving convergence conditions.

Three different heuristics are regarded. Two heuristics with fixed parameters and the third heuristic with parameters obtained by global stochastic optimization.

Using the first heuristic we keep the current schedule until the better schedule is found. The parameter is the probability to pass by the next teacher. This way we can reach just a sort of local minimum.

A natural first step to provide convergence to the global minimum is the Simulated Annealing (SA): we move from the current schedule to the permuted schedule with probability

|  |  | (4)

Here is the iteration number and is the "initial temperature." The logarithmic "cooling schedule" follows from convergence conditions [18].

The difference from the traditional SA is that here we want to improve the average results for some fixed number of iterations . Thus the cooling rate should be regarded, too. A way to do it is by introducing the cooling rate parameter .

This transforms expression (4)

|  |  | (5)

where defines an "initial temperature" of SA and describes the "cooling rate".

The third heuristic optimizes all three parameters for a fixed optimization time defined by the number of "internal" iterations . Fig. 5. shows the results of SA optimization in school scheduling. Fig. 6. shows initial and optimized student schedules.

# Distance Studies

For the graduate level distance and class-room studies of the theory of games and markets in the Internet environment a set of examples of global and discrete optimization was implemented using platform independent Java applets and servlets. Here is the list of web-sites:
The theoretical background and the complete description of the software is in the file 'stud2.pdf'. Examples are described in two separate sections: "Global Optimization" for continuous variables, and "Discrete Optimization" for discrete optimization plus applications of linear and dynamic programming.
All the results for international users are in English. Specific examples designed for Lithuanian universities are in Lithuanian.

The video-conferencing is regular: each Friday from 8:00 until 9:30 EET (EEST). Now the language is Lithuanian because no foreign students are connected. However, the essential part of the web-site is in English so the English broadcasts are possible, too. The main difficulty for English speaking students apparently are early hours (7:00-8:30 CET) .
The connection is free. Static IP and NetMeeting is used. Advance notification is assumed. Interactive mode is easy using some standard Audio and Video tools.
Fig. 7. is a snapshot of video-conferencing about the Wiener model with some "on-line" graphical explanations in response to students questions.

All the video-conferences are recorded and put on web-site:
http://distance.ktu.lt/vips/join.php?sr=242

# Conclusions

1. The objective of the paper is to start the scientific collaboration with colleagues on similar lines.
2. The growing power of internet presents new problems and opens new possibilities for distant scientific collaboration and graduate studies. Therefore some nontraditional ways for presentation of scientific results should be defined.
3. The paper shows an example of specific style designed for encouragement of new approaches to presentation and sharing of scientific results.
4. The results of optimization show the possibilities of some nontraditional ways of graduate studies and scientific collaboration by creating and using a specific environment for E-education.
5. Examples of applications of the Bayesian heuristic approach show the efficiency of automated tuning of heuristics.

## Bibliography

1
  Horst, R., Pardalos, P.:
  Handbook of Global Optimization.
  Kluwer Academic Publishers, Dordrecht/Boston/London (1995)

2
  .Calvin, J., Zilinskas, A.:
  One-dimensional p-algorithm with convergence rate o (n− 3cδ) for smooth functions.
  JOTA Journal pf Optimization Theory and Applications 106 (2000) 297-307

3
  Diaconis, P.:
  Bayesian numerical analysis.
  In: Statistical Decision Theory and Related Topics.
  Springer Verlag (1988) 163-175

4
  Mockus, J., L.Mockus:
  Bayesian approach to global optimization and applications.
  In: Theory of Optimal Decision. Volume 12.
  Institute of Mathematics and Cybernetics, Akademia Nauk Lithuanian SSR, Vilnius, Lithuania (1987) 57-70 (in Russian).

5
  Mockus, J.:
  A Set of Examples of Global and Discrete Optimization: Application of Bayesian Heuristic Approach.
  Kluwer Academic Publishers (2000) ISBN 0-7923-6359-0.

6
  DeGroot, M.:
  Optimal Statistical Decisions.
  McGraw-Hill, New York (1970)

7
  Mockus, J.:
  Bayesian approach to global optimization.
  Kluwer Academic Publishers, Dordrecht-London-Boston (1989)

8
  Berger, J.:
  Statistical Decision Theory and Bayesian Analysis.
  Springer-Verlag, Berlin, Heidelberg (1985)

9
  Kadane, J., Wasilkowski, G.:
  Average case -complexity in computer science- a bayesian view.
  In: Bayesian Statistics 2.
  Elsevier Science Publishers (1985) 361-374

10
  Lindley, D.:
  Bayesian Statistics: A Review.
  SIAM, Philadelphia (1971)

11
  Savage, L.:
  Foundations of Statistics.
  Wiley, New York (1954)

12
  T.L.Fine:
  Theories of Probability.
  Academic Press, New York (1973)

13
  Zilinskas, A.:
  Global optimization: axiomatic of statistical models, algorithms and their applications.
  Mokslas, Vilnius, Lithuania (1986) in Russian.

14
  Goldberg, D.E.:
  Genetic Algorithms in Search, Optimization, and Machine Learning.
  Addison-Wesley, Reading, MA (1989)

15
  Mavridou, T., Pardalos, P., Pitsoulis, L., Resende, M.:
  A GRASP for the biquadratic assignment problem.
  European Journal of Operations Research 105 (1998) 613-621

16
  Glover, F.:
  Tabu search: improved solution alternatives.
  In: Mathematical Programming. State of the Art 1994.
  University of Michigan (1994) 64-92

17
  Mockus, J., Eddy, W., Mockus, A., Mockus, L., Reklaitis, G.:
  Bayesian Heuristic Approach to Discrete and Global Optimization.
  Kluwer Academic Publishers, ISBN 0-7923-4327-1, Dordrecht-London-Boston (1997)

18
  Cohn, H., Fielding, M.:
  Simulated annealing: Searching for an optimal temperature schedule.
  SIAM J. Optim. 9 (1999) 779-802

# About this document ...

Bayesian Heuristic Approach to Automated Parameter Tuning, Investigation of Examples

This document was generated using the LaTeX2`HTML` translator Version 2002-2-1 (1.70)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html `-local_icons -split 3 -image_type gif -show_section_numbers -html_version 4.0 tune4.tex`

The translation was initiated by mockus on 2006-05-01

- Introduction
- Bayesian Approach (BA)
- Software Framework for Global Optimization (GMJ)
  - Bayesian Search, "Bayes"
  - Monte Carlo, Uniform Search, "Mig1"
  - Convergence
  - Projection
- Improving Expert Heuristics
- Optimization of Mixed Heuristics
  - Greedy Heuristics
  - Cut Optimization, "Cut"
  - Permutation Heuristics
- Optimization of Simulated Annealing (SA)
- Distance Studies
- Conclusions
- Bibliography
- About this document ...