Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/17/15 19:13:19 (8 years ago)
Author:
gkronber
Message:

#2283: implemented first crude version of extreme hunter algorithm in branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization-gkr/HeuristicLab.Algorithms.Bandits/Policies/ActiveLearningPolicy.cs

    r11806 r12876  
    99namespace HeuristicLab.Algorithms.Bandits.BanditPolicies {
    1010  public class ActiveLearningPolicy : IBanditPolicy {
     11    public double MaxReward { get; private set; }
     12    public ActiveLearningPolicy(double maxReward = 1.0) {
     13      this.MaxReward = maxReward;
     14    }
    1115    public int SelectAction(Random random, IEnumerable<IBanditPolicyActionInfo> actionInfos) {
    1216      var myActionInfos = actionInfos.OfType<DefaultPolicyActionInfo>();
     
    2933          q = aInfo.SumReward / aInfo.Tries;
    3034          var b = Math.Sqrt(Math.Log(2.0 * k * totalTries / delta) / (2.0 * aInfo.Tries));
    31           u = q + 0.5 * b;
    32           l = q - 0.5 * b;
     35          u = q + MaxReward * b;
     36          l = q - MaxReward * b;
    3337        }
    3438        bestActions.Add(aIdx);
Note: See TracChangeset for help on using the changeset viewer.