<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to DMAB</title><link>https://sourceforge.net/p/ugp3/wiki/DMAB/</link><description>Recent changes to DMAB</description><atom:link href="https://sourceforge.net/p/ugp3/wiki/DMAB/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 08 Jun 2015 14:42:13 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/ugp3/wiki/DMAB/feed" rel="self" type="application/rss+xml"/><item><title>DMAB modified by Alberto Tonda</title><link>https://sourceforge.net/p/ugp3/wiki/DMAB/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -1,9 +1,11 @@
 Choosing operators using DMAB
 -----------------------------

+µGP exploits a Dynamic Multi-Armed Bandit logic to self-adapt the probability of activating a certain genetic operator at each generation.
+
 The general goal of the Multi Armed Bandit problem is to get the highest reward out of a cash machine with multiple arms, each of which has its own unknown reward probability distribution. Good MAB algorithms find a right balance between trying each arm to discover their probability distribution (at the risk of activating multiple times an arm that gives no benefit) and exploiting the arm with the highest perceived reward probability (at the risk of missing another arm with a higher reward). The problem becomes dynamic when the reward probabilities of the arms vary over time.

-In the context of Evolutionary Computation, MAB assimilates each genetic operator to an arm of the bandit. The goal of the MAB algorithm in MicroGP is to apply the operators that yield the best increase of fitness among the generated offspring. We use the dynamic (DMAB) variant because operators can be more or less relevant at different stages of the evolution.  The DMAB implementation in MicroGP is inspired by the 2008 paper from DaCosta et al.  "Adaptive Operator Selection with Dynamic Multi Armed Bandit" (1), with a few modifications to accommodate with MicroGP's generation flow.
+In the context of Evolutionary Computation, MAB assimilates each genetic operator to an arm of the bandit. The goal of the MAB algorithm in MicroGP is to apply the operators that yield the best increase of fitness among the generated offspring. We use the dynamic (DMAB) variant because operators can be more or less relevant at different stages of the evolution.  The DMAB implementation in MicroGP is inspired by the 2008 paper from DaCosta et al.  "Adaptive Operator Selection with Dynamic Multi Armed Bandit" (1), with a few modifications to accommodate with MicroGP's generation flow (2).

 ### Main steps of the DMAB algorithm

@@ -67,4 +69,5 @@

 ### References

-1.  DaCosta, Luis, et al. "Adaptive operator selection with dynamic multi-armed bandits." Proceedings of the 10th annual conference on Genetic and evolutionary computation. ACM, 2008. 
+1.  DaCosta, Luis, et al. "Adaptive operator selection with dynamic multi-armed bandits." Proceedings of the 10th annual conference on Genetic and evolutionary computation (GECCO). ACM, 2008. 
+2.  Belluz J., Gaudesi M., Squillero G., Tonda A., "Operator Selection using Improved Dynamic Multi-Armed Bandit." Proceedings of the 17th annual conference on Genetic and evolutionary computation (GECCO). ACM, 2015.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alberto Tonda</dc:creator><pubDate>Mon, 08 Jun 2015 14:42:13 -0000</pubDate><guid>https://sourceforge.net2289708a36a9436f42c577a1a86304fc9b6f6051</guid></item><item><title>DMAB modified by Jany Belluz</title><link>https://sourceforge.net/p/ugp3/wiki/DMAB/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -61,11 +61,9 @@

 The other problem of the DMAB implementation is that we have to select an operator several times in a row without being able to properly update the indicators between each selection. Indeed, MicroGP can compute the reward of an operator only when the children have been evaluated, at the end of the generation. During one generation MicroGP can apply any arbitrary number of operators, any number of times. 

-Without any modification we would be applying only one operator per generation, the one with the best MAB score from the last indicator update. This situation would not allow any exploration during the generation, only exploitation. To prevent that, we count the number of non-rewarded-yet executions of the operator, and we add it to the UCB1 formula in order to lower its score, so eventually another operator can take over during the generation and be given a chance. Here is the modified formula:
+Without any modification we would be applying only one operator per generation, the one with the best MAB score from the last indicator update. This situation would not allow any exploration during the generation, only exploitation. To prevent that, we use a Russian roulette selection based on the MAB scores instead of taking always the best. This randomized selection still favors the best operator and keeps exploring the others. However, its performance against standard DMAB has not yet been measured precisely. 

-`(a * p_i + b) + sqrt(2 * log(sum of n_k for all k)) / (n_i + nNonRewardedYet_i))`
-
-We apply the same trick when there are operators that have never been used yet.  In order to choose each of them in turn, we affect a very high score (1000) to such an unused operator, minus its number of non rewarded executions.
+Finally, in order to call at least once every operator, we compute a special score for operators that have never been used yet. We affect a very high score to such an unused operator, so that its chances of being selected are overwhelming compared to those of the other operators. After it has been selected, we reduce its "high score" value, which allows the Russian Roulette to switch to the next unused operator.

 ### References

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jany Belluz</dc:creator><pubDate>Thu, 27 Nov 2014 15:33:54 -0000</pubDate><guid>https://sourceforge.neta126949cc0200a6550a2853c19aff4e4c762c8ed</guid></item><item><title>DMAB modified by Jany Belluz</title><link>https://sourceforge.net/p/ugp3/wiki/DMAB/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,4 +1,3 @@
-
 Choosing operators using DMAB
 -----------------------------

@@ -22,10 +21,9 @@
 3.  Choose the next arm to use according to the Upper Confidence Bound algorithm.
     * If some arm has not been used yet (`n_i == 0`), choose it.
     * If all arms have already been used, choose the arm `i` that maximizes the following quantity (UCB1 formula):
+        `(a * p_i + b) + sqrt(2 * log(sum of n_k for all k)) / n_i)`

-      `(a * p_i + b) + sqrt(2 * log(sum of n_k for all k)) / n_i)`
-
-      where `(a * p_i + b)`, the scaled mean reward, favors exploitation of good arms, and the second term favors exploration of arms that have not been used since some time.
+        where `(a * p_i + b)`, the scaled mean reward, favors exploitation of good arms, and the second term favors exploration of arms that have not been used since some time.

 4.  Use the chosen arm, measure the obtained reward `r`, and update the arm's variables as follows:
     * `p_i := (n_i * p_i + r) / (n_i + 1)`
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jany Belluz</dc:creator><pubDate>Sat, 11 Oct 2014 08:55:13 -0000</pubDate><guid>https://sourceforge.net3367c7ddaf898ed13d07db192c36be3b0abbb86d</guid></item><item><title>DMAB modified by Giovanni Squillero</title><link>https://sourceforge.net/p/ugp3/wiki/DMAB/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="choosing-operators-using-dmab"&gt;Choosing operators using DMAB&lt;/h2&gt;
&lt;p&gt;The general goal of the Multi Armed Bandit problem is to get the highest reward out of a cash machine with multiple arms, each of which has its own unknown reward probability distribution. Good MAB algorithms find a right balance between trying each arm to discover their probability distribution (at the risk of activating multiple times an arm that gives no benefit) and exploiting the arm with the highest perceived reward probability (at the risk of missing another arm with a higher reward). The problem becomes dynamic when the reward probabilities of the arms vary over time.&lt;/p&gt;
&lt;p&gt;In the context of Evolutionary Computation, MAB assimilates each genetic operator to an arm of the bandit. The goal of the MAB algorithm in MicroGP is to apply the operators that yield the best increase of fitness among the generated offspring. We use the dynamic (DMAB) variant because operators can be more or less relevant at different stages of the evolution.  The DMAB implementation in MicroGP is inspired by the 2008 paper from DaCosta et al.  "Adaptive Operator Selection with Dynamic Multi Armed Bandit" (1), with a few modifications to accommodate with MicroGP's generation flow.&lt;/p&gt;
&lt;h3 id="main-steps-of-the-dmab-algorithm"&gt;Main steps of the DMAB algorithm&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Initialize the following variables for each arm &lt;code&gt;i&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;p_i := 0&lt;/code&gt; (mean observed reward)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;n_i := 0&lt;/code&gt; (number of uses of this arm)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;m_i := 0&lt;/code&gt; (average deviation of observed rewards)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;M_i := 0&lt;/code&gt; (maximum deviation of observed rewards)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Determine scaling parameters &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; for the mean rewards, by solving the following equations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sum of (a * p_i + b) for all i == 1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;max of (a * p_i + b) for all i == CA_scale&lt;/code&gt; where &lt;code&gt;CA_scale&lt;/code&gt; is a constant, usually 1.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Choose the next arm to use according to the Upper Confidence Bound algorithm.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If some arm has not been used yet (&lt;code&gt;n_i == 0&lt;/code&gt;), choose it.&lt;/li&gt;
&lt;li&gt;If all arms have already been used, choose the arm &lt;code&gt;i&lt;/code&gt; that maximizes the following quantity (UCB1 formula):&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;(a * p_i + b) + sqrt(2 * log(sum of n_k for all k)) / n_i)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;where &lt;code&gt;(a * p_i + b)&lt;/code&gt;, the scaled mean reward, favors exploitation of good arms, and the second term favors exploration of arms that have not been used since some time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use the chosen arm, measure the obtained reward &lt;code&gt;r&lt;/code&gt;, and update the arm's variables as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;p_i := (n_i * p_i + r) / (n_i + 1)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;n_i := n_i + 1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;m_i := m_i + (p_i - r + delta)&lt;/code&gt; where &lt;code&gt;delta&lt;/code&gt; is a constant.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;M_i := max(M_i, m_i)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Test for changes in the arm's probability distribution:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If &lt;code&gt;M_i - m_i &amp;gt; lambda&lt;/code&gt;, where lambda is a constant, go back to step one to restart the bandit.&lt;/li&gt;
&lt;li&gt;Else, continue using the bandit by going back to step two.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Refer to the paper the work of DaCosta et al. (1) to know about the meaning of the various indicators and constants.&lt;/p&gt;
&lt;h3 id="implementation-in-microgp"&gt;Implementation in MicroGP&lt;/h3&gt;
&lt;p&gt;In MicroGP, an arm is a genetic operator, and the reward is determined by the quality of the generated offspring. To store indicators about the available operators, we use the &lt;code&gt;Statistics&lt;/code&gt; class. Each population has a &lt;code&gt;Statistics&lt;/code&gt; instance. Inside this class, each operator has a &lt;code&gt;Data&lt;/code&gt; instance that contains the four DMAB indicators.&lt;/p&gt;
&lt;p&gt;During a generation, MicroGP applies several operators before evaluating the individuals and measuring the rewards. Moreover, the execution of an operator generate several individuals or groups, which will all get a different evaluation. The reward of for this call to the operator must aggregate in some way the various evaluations of all generated offspring. These two constraints impose the introduction of another data structure, and small modifications to the algorithm.&lt;/p&gt;
&lt;h4 id="aggregating-evaluation-results-into-a-reward-value"&gt;Aggregating evaluation results into a reward value&lt;/h4&gt;
&lt;p&gt;In order to link the evaluation of an individual to the reward of an operator, we create an instance of &lt;code&gt;CallData&lt;/code&gt; after each call. We the call returns new offspring, we put a reference to the &lt;code&gt;CallData&lt;/code&gt; instance in the &lt;code&gt;Lineage&lt;/code&gt; of the offspring.&lt;/p&gt;
&lt;p&gt;Later on, when the offspring has been evaluated, we loop over each new individual or group and build inside the &lt;code&gt;CallData&lt;/code&gt; object and histogram of the performance of the offspring. That is, if a child is better than all other individuals of the previous generation, we increment the &lt;code&gt;VeryGood&lt;/code&gt; performance class of the operator. If the child is better than its parents, we count it as &lt;code&gt;Good&lt;/code&gt;. Conversely, if the child is worse than its parents or worse than all the previous individuals, it is counted respectively as &lt;code&gt;Bad&lt;/code&gt; or &lt;code&gt;VeryBad&lt;/code&gt;. If the child has a fitness between that of its parents, it is counted as &lt;code&gt;Normal&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Illustration of the performance scale" src="https://i.imgur.com/pn6A9u9.png" rel="nofollow" /&gt;&lt;/p&gt;
&lt;p&gt;When all newly evaluated children have been aggregated into the &lt;code&gt;CallData&lt;/code&gt; object, we use each of those histograms to reward the operator. We use the "boolean reward" strategy, which means the reward for a call can only take the values 0 or 1. We thus give a positive reward to the operator if it has produced at least one &lt;code&gt;Good&lt;/code&gt; or &lt;code&gt;VeryGood&lt;/code&gt; individual.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Instance diagram" src="https://i.imgur.com/6mCrLMx.png" rel="nofollow" /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;CallData&lt;/code&gt; instances are destroyed at the end of each generation.&lt;/p&gt;
&lt;h4 id="performing-several-operator-selections-without-reward-updates"&gt;Performing several operator selections without reward updates&lt;/h4&gt;
&lt;p&gt;The other problem of the DMAB implementation is that we have to select an operator several times in a row without being able to properly update the indicators between each selection. Indeed, MicroGP can compute the reward of an operator only when the children have been evaluated, at the end of the generation. During one generation MicroGP can apply any arbitrary number of operators, any number of times. &lt;/p&gt;
&lt;p&gt;Without any modification we would be applying only one operator per generation, the one with the best MAB score from the last indicator update. This situation would not allow any exploration during the generation, only exploitation. To prevent that, we count the number of non-rewarded-yet executions of the operator, and we add it to the UCB1 formula in order to lower its score, so eventually another operator can take over during the generation and be given a chance. Here is the modified formula:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;(a * p_i + b) + sqrt(2 * log(sum of n_k for all k)) / (n_i + nNonRewardedYet_i))&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;We apply the same trick when there are operators that have never been used yet.  In order to choose each of them in turn, we affect a very high score (1000) to such an unused operator, minus its number of non rewarded executions.&lt;/p&gt;
&lt;h3 id="references"&gt;References&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;DaCosta, Luis, et al. "Adaptive operator selection with dynamic multi-armed bandits." Proceedings of the 10th annual conference on Genetic and evolutionary computation. ACM, 2008. &lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Giovanni Squillero</dc:creator><pubDate>Fri, 10 Oct 2014 14:09:30 -0000</pubDate><guid>https://sourceforge.net8dda929c46f077f68913caf6b9577ec077d1492e</guid></item></channel></rss>