Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/11/15 20:11:35 (9 years ago)
Author:
gkronber
Message:

#2283: cleanup and included HeuristicLab.dlls to create a self-contained branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.GrammaticalOptimization/SequentialDecisionPolicies/GenericFunctionApproximationGrammarPolicy.cs

    r11980 r11981  
    6060        originalIdx++;
    6161      }
    62 
    63      
    64       /*
    65       const double beta = 10;
    66       var w = from idx in Enumerable.Range(0, maxIdx)
    67               let afterStateQ = activeAfterStates[idx]
    68               select Math.Exp(beta * afterStateQ);
    69 
    70       var bestAction = Enumerable.Range(0, maxIdx).SampleProportional(random, w);
    71       selectedStateIdx = actionIndexMap[bestAction];
    72       Debug.Assert(selectedStateIdx >= 0);
    73       */
    7462     
    7563     
    76       if (random.NextDouble() < 0.5) {
     64      // TODO: policy should be a parameter of the function approximation policy
     65      if (random.NextDouble() < 0.2) {
    7766        selectedStateIdx = actionIndexMap[random.Next(maxIdx)];
    7867      } else {
     
    139128    private void UpdateWeights(string state, double reward) {
    140129      double delta = reward - GetValue(state);
    141       // delta /= problem.GetFeatures(state).Count();
    142       //const double alpha = 0.001;
    143130      foreach (var feature in problem.GetFeatures(state)) {
    144131        featureTries[feature.Id] = GetFeatureTries(feature.Id) + 1;
Note: See TracChangeset for help on using the changeset viewer.