Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12295 for branches


Ignore:
Timestamp:
04/08/15 13:05:53 (10 years ago)
Author:
gkronber
Message:

#2283: force selection of untried alternatives

Location:
branches/HeuristicLab.Problems.GrammaticalOptimization-gkr
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization-gkr/HeuristicLab.Algorithms.GrammaticalOptimization/SequentialDecisionPolicies/GenericPolicy.cs

    r12294 r12295  
    4848      foreach (var afterState in afterStates) {
    4949        if (!Done(afterState)) {
    50           activeAfterStates[idx] = GetValue(afterState);
     50          if (GetTries(afterState) == 0)
     51            activeAfterStates[idx] = double.PositiveInfinity;
     52          else
     53            activeAfterStates[idx] = GetValue(afterState);
    5154          actionIndexMap[idx] = originalIdx;
    5255          idx++;
     
    179182      Console.WriteLine(Q.Values.Max());
    180183      var topTries = Q.Keys.OrderByDescending(key => T[key]).Take(50);
    181       var topQs = Q.Keys.Where(key=>key.Contains(",")).OrderByDescending(key => Q[key]).Take(50);
     184      var topQs = Q.Keys.Where(key => key.Contains(",")).OrderByDescending(key => Q[key]).Take(50);
    182185      foreach (var t in topTries.Zip(topQs, Tuple.Create)) {
    183186        var id1 = t.Item1;
  • branches/HeuristicLab.Problems.GrammaticalOptimization-gkr/HeuristicLab.Problems.GrammaticalOptimization/Problems/SymbolicRegressionPoly10Problem.cs

    r12294 r12295  
    163163      //   .Concat(new Feature[] { new Feature(CanonicalRepresentation(phrase), 1.0) });
    164164
    165       //return new Feature[] { new Feature(phrase, 1.0), };
    166 
    167       var partialInterpreter = new PartialExpressionInterpreter();
    168       var vars = new double[] { 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, };
    169       var s = partialInterpreter.Interpret(phrase, vars);
    170       //if (s.Any())
    171       //  return new Feature[] { new Feature(s.Pop().ToString(), 1.0), };
    172       //else
    173       //  return new Feature[] { new Feature("$", 1.0), };
    174       return new Feature[] { new Feature(string.Join(",", s), 1.0) };
     165      return new Feature[] { new Feature(phrase, 1.0), };
     166
     167      // var partialInterpreter = new PartialExpressionInterpreter();
     168      // var vars = new double[] { 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, };
     169      // var s = partialInterpreter.Interpret(phrase, vars);
     170      // //if (s.Any())
     171      // //  return new Feature[] { new Feature(s.Pop().ToString(), 1.0), };
     172      // //else
     173      // //  return new Feature[] { new Feature("$", 1.0), };
     174      // return new Feature[] { new Feature(string.Join(",", s), 1.0) };
    175175    }
    176176
  • branches/HeuristicLab.Problems.GrammaticalOptimization-gkr/Main/Program.cs

    r12294 r12295  
    5454        //   new HeuristicLab.Algorithms.Bandits.GrammarPolicies.GenericGrammarPolicy(problem, new UCB1TunedPolicy()));
    5555        var policy = new GenericPolicy(problem);
    56         var alg = new SequentialSearch(problem, 23, random, 1,
     56        var alg = new SequentialSearch(problem, 23, random, 0,
    5757          policy);
    5858        //var alg = new MonteCarloTreeSearch(problem, 23, random, new UCB1Policy(), new RandomSimulation(problem, random, 30));
     
    7171            if (iterations % 1000 == 0) Console.Clear();
    7272            Console.SetCursorPosition(0, 0);
    73             // alg.PrintStats();
    74             policy.PrintStats();
     73            alg.PrintStats();
     74            //policy.PrintStats();
    7575          }
    7676
Note: See TracChangeset for help on using the changeset viewer.