Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/29/14 11:02:36 (9 years ago)
Author:
gkronber
Message:

#2283: worked on grammatical optimization problem solvers (simple MCTS done)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization.Test/TestBanditPolicies.cs

    r11710 r11727  
    1515      var seedForPolicy = globalRand.Next();
    1616      var nArms = 10;
     17      //Console.WriteLine("Exp3 (gamma=0.01)");
     18      //TestPolicyBernoulli(globalRand, nArms, new Exp3Policy(new Random(seedForPolicy), nArms, 1));
     19      //Console.WriteLine("Exp3 (gamma=0.05)");
     20      //estPolicyBernoulli(globalRand, nArms, new Exp3Policy(new Random(seedForPolicy), nArms, 1));
     21      Console.WriteLine("Thompson (Bernoulli)");
     22      TestPolicyBernoulli(globalRand, nArms, new BernoulliThompsonSamplingPolicy(new Random(seedForPolicy), nArms));
    1723      Console.WriteLine("Random");
    18       TestPolicyBernoulli(globalRand, nArms, new RandomPolicy(new Random(seedForPolicy), 10));
     24      TestPolicyBernoulli(globalRand, nArms, new RandomPolicy(new Random(seedForPolicy), nArms));
    1925      Console.WriteLine("UCB1");
    20       TestPolicyBernoulli(globalRand, nArms, new UCB1Policy(10));
     26      TestPolicyBernoulli(globalRand, nArms, new UCB1Policy(nArms));
    2127      Console.WriteLine("UCB1Tuned");
    22       TestPolicyBernoulli(globalRand, nArms, new UCB1TunedPolicy(10));
     28      TestPolicyBernoulli(globalRand, nArms, new UCB1TunedPolicy(nArms));
    2329      Console.WriteLine("UCB1Normal");
    24       TestPolicyBernoulli(globalRand, nArms, new UCBNormalPolicy(10));
     30      TestPolicyBernoulli(globalRand, nArms, new UCBNormalPolicy(nArms));
    2531      Console.WriteLine("Eps(0.01)");
    26       TestPolicyBernoulli(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), 10, 0.01));
     32      TestPolicyBernoulli(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), nArms, 0.01));
    2733      Console.WriteLine("Eps(0.05)");
    28       TestPolicyBernoulli(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), 10, 0.05));
    29       Console.WriteLine("Eps(0.1)");
    30       TestPolicyBernoulli(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), 10, 0.1));
    31       Console.WriteLine("Eps(0.2)");
    32       TestPolicyBernoulli(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), 10, 0.2));
    33       Console.WriteLine("Eps(0.5)");
    34       TestPolicyBernoulli(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), 10, 0.5));
     34      TestPolicyBernoulli(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), nArms, 0.05));
     35      //Console.WriteLine("Eps(0.1)");
     36      //TestPolicyBernoulli(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), nArms, 0.1));
     37      //Console.WriteLine("Eps(0.2)");
     38      //TestPolicyBernoulli(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), nArms, 0.2));
     39      //Console.WriteLine("Eps(0.5)");
     40      //TestPolicyBernoulli(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), nArms, 0.5));
    3541    }
    3642    [TestMethod]
     
    4046      var seedForPolicy = globalRand.Next();
    4147      var nArms = 10;
     48      Console.WriteLine("Thompson (Gaussian)");
     49      TestPolicyNormal(globalRand, nArms, new GaussianThompsonSamplingPolicy(new Random(seedForPolicy), nArms));
    4250      Console.WriteLine("Random");
    43       TestPolicyNormal(globalRand, nArms, new RandomPolicy(new Random(seedForPolicy), 10));
     51      TestPolicyNormal(globalRand, nArms, new RandomPolicy(new Random(seedForPolicy), nArms));
    4452      Console.WriteLine("UCB1");
    45       TestPolicyNormal(globalRand, nArms, new UCB1Policy(10));
     53      TestPolicyNormal(globalRand, nArms, new UCB1Policy(nArms));
    4654      Console.WriteLine("UCB1Tuned");
    47       TestPolicyNormal(globalRand, nArms, new UCB1TunedPolicy(10));
     55      TestPolicyNormal(globalRand, nArms, new UCB1TunedPolicy(nArms));
    4856      Console.WriteLine("UCB1Normal");
    49       TestPolicyNormal(globalRand, nArms, new UCBNormalPolicy(10));
     57      TestPolicyNormal(globalRand, nArms, new UCBNormalPolicy(nArms));
     58      //Console.WriteLine("Exp3 (gamma=0.01)");
     59      //TestPolicyNormal(globalRand, nArms, new Exp3Policy(new Random(seedForPolicy), nArms, 0.01));
     60      //Console.WriteLine("Exp3 (gamma=0.05)");
     61      //TestPolicyNormal(globalRand, nArms, new Exp3Policy(new Random(seedForPolicy), nArms, 0.05));
    5062      Console.WriteLine("Eps(0.01)");
    51       TestPolicyNormal(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), 10, 0.01));
     63      TestPolicyNormal(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), nArms, 0.01));
    5264      Console.WriteLine("Eps(0.05)");
    53       TestPolicyNormal(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), 10, 0.05));
    54       Console.WriteLine("Eps(0.1)");
    55       TestPolicyNormal(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), 10, 0.1));
    56       Console.WriteLine("Eps(0.2)");
    57       TestPolicyNormal(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), 10, 0.2));
    58       Console.WriteLine("Eps(0.5)");
    59       TestPolicyNormal(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), 10, 0.5));
     65      TestPolicyNormal(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), nArms, 0.05));
     66      //Console.WriteLine("Eps(0.1)");
     67      //TestPolicyNormal(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), nArms, 0.1));
     68      //Console.WriteLine("Eps(0.2)");
     69      //TestPolicyNormal(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), nArms, 0.2));
     70      //Console.WriteLine("Eps(0.5)");
     71      //TestPolicyNormal(globalRand, nArms, new EpsGreedyPolicy(new Random(seedForPolicy), nArms, 0.5));
    6072    }
    6173
Note: See TracChangeset for help on using the changeset viewer.