SeriesMachine Learning12 / 20

Randomized Optimization

Module 12 of CS 7641 - Machine Learning @ Georgia Tech. Lesson 1 of Unsupervised Learning Series.

What is Unsupervised Learning?#

Recall that Machine Learning (ML) is divided into three primary subfields:

f(X)=yf(\mathbf{X}) = \mathbf{y}

f(X)f(\mathbf{X})

π(s)=a   sS\pi(s) = a ~~~ \forall s \in S

We more concretely define Unsupervised Learning as a class of machine learning algorithms dedicated to analyzing unlabeled data. There are many types of unsupervised learning methods, with each type serving a different goal.

In this lesson, we will focus on randomized optimization techniques. Note that randomized optimization is a general class of computational methods, and is not typically considered a distinct subfield of unsupervised learning.

Randomized Optimization#

What is Optimization?#

Optimization refers to a general problem in which we seek to “find the best” value relative to a function of interest. We define the following components w.r.t. an optimization problem:

The goal of any optimization problem is therefore to find the input xX\mathbf{x} \in \mathbf{X} which produces the best value of the objective function. This is analogous to an argmax or argmin depending on which direction is preferred.

General Approaches#

We can approach optimization in a few key ways - often our choice of optimization strategy depends on characteristics of the problem at hand.

What if these assumptions don’t hold? For example, consider a hypothetical problem with a large input space and complex function with no solvable derivative. Under these circumstances, we turn to Randomized Optimization (RO), which introduces stochasticity into the optimization process to improve search efficiency.

RO Methods#

Hill Climbing#

Hill Climbing is a basic RO algorithm which relies on the notion of proximity to iteratively optimize an objective function.

  1. Randomly initialize input by selecting xX\mathbf{x} \in \mathbf{X}.
  2. Loop indefinitely:
  • Define neighbors to x\mathbf{x} as nN\mathbf{n} \in \mathbf{N}.
  • Calculate output value f(n)f(\mathbf{n}) for each neighbor and current input f(x)f(\mathbf{x}).
  • If: f(n)>f(x)f(\mathbf{n}) > f(\mathbf{x}) for any nN\mathbf{n} \in \mathbf{N}, select the neighbor with maximal output as the new input x\mathbf{x}.
  • Else: terminate the loop.

Unfortunately, this vanilla technique is prone to becoming stuck in local optima.

local-optima

We therefore use variants such as Random Restart Hill Climbing, which performs multiple different iterations of hill climbing (which implies starting from different randomly-initialized input points). The final optimized input is calculated by comparing outputs across iterations.

Simulated Annealing#

Instead of always proceeding in the direction of ascent, other approaches may choose to select a “worse” input during search. Simulated Annealing is one such method which probabilistically selects the next input during search using temperature TT. In this context, “annealing” references the repeated heating and cooling process applied in metallurgy.

For finite set of iterations:

  • Sample new point xt\mathbf{x_t} in neighborhood N(x)N(\mathbf{x}).
  • Jump to this point with probability given by acceptance function Pr(x,xt,T)\Pr(\mathbf{x}, \mathbf{x}_t, T) (below).
  • Decrease temperature T.

Pr(x,xt,T)={1if f(xt)f(x)ef(x)f(xt)Totherwise\Pr(\mathbf{x}, \mathbf{x}_t, T) = \begin{cases} 1 & \text{if} ~f(\mathbf{x_t}) \geq f(\mathbf{x}) \\ e^{\frac{f(\mathbf{x}) - f(\mathbf{x}_t)}{T}} & \text{otherwise} \end{cases}

Simulated annealing aims to strike a balance between exploration vs. exploitation, as opposed to the completely exploitative strategy of hill climbing.

Genetic Algorithms#

Finally, Genetic Algorithms refer to an alternative RO approach which combines characteristics of inputs from one iteration to generate inputs for the subsequent iteration. More specifically, genetic algorithms involve the following components:

Generate initial population of size kk. Loop until convergence:

  • Compute fitness for all members of population xtPt\mathbf{x}_t \in P_t.
  • Select “most fit” individuals to be paired for crossover.
  • Introduce mutation at certain rate mrm_r.

The notion of crossover assumes that different subspaces of the input are separately important for optimization. To better understand crossover, consider the following example of optimization over 8-bit strings.

crossover

MIMIC#

MIMIC is another RO method which performs optimization by directly modeling a probability distribution over inputs xX\mathbf{x} \in \mathbf{X}. More specifically, we define the following distribution:

Prθ(x)={1zθif f(x)θ0otherwise\Pr_{\theta}(\mathbf{x}) = \begin{cases} \frac{1}{z_\theta} & \text{if} ~ f(\mathbf{x}) \geq \theta \\ 0 & \text{otherwise} \end{cases}

This implies that Prθmax(x)\Pr_{\theta_{\text{max}}}(\mathbf{x}) is a uniform distribution over optimal points, and Prθmin(x)\Pr_{\theta_{\text{min}}}(\mathbf{x}) is a uniform distribution over all inputs in the input space. MIMIC progresses by starting with θmin\theta_{\text{min}} and iteratively proceeding towards θmax\theta_{\text{max}}.

Loop until finished:

  • Generate samples from Prθt(x)\Pr_{\theta_t}(\mathbf{x}).
  • Set θt+1\theta_{t+1} to nn-th percentile of samples (ranked by objective function score).
  • Retain only samples with f(x)>θt+1f(\mathbf{x}) > \theta_{t+1}.
  • Estimate new distribution Prθt+1(x)\Pr_{\theta_{t+1}}(\mathbf{x}) with remaining samples.

MIMIC takes a special approach to estimating the distribution over samples via dependency trees. For more on this topic, check out the original MIMIC paper from Charles Isbell.


(all images obtained from Georgia Tech ML course materials)

License

CC BY-NC-SA 4.0 This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Related Posts