Changeset 11981 for branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.GrammaticalOptimization
- Timestamp:
- 02/11/15 20:11:35 (10 years ago)
- Location:
- branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.GrammaticalOptimization
- Files:
-
- 5 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.GrammaticalOptimization/HeuristicLab.Algorithms.GrammaticalOptimization.csproj
r11850 r11981 39 39 <ItemGroup> 40 40 <Compile Include="ISequentialDecisionPolicy.cs" /> 41 <Compile Include="SequentialDecisionPolicies\GenericContextualGrammarPolicy.cs" />42 41 <Compile Include="SequentialDecisionPolicies\GenericFunctionApproximationGrammarPolicy.cs" /> 43 42 <Compile Include="SequentialDecisionPolicies\GenericGrammarPolicy.cs" /> 44 <Compile Include="SequentialDecisionPolicies\GenericTDPolicy.cs" />45 43 <Compile Include="SequentialDecisionPolicies\GrammarPolicy.cs" /> 46 44 <Compile Include="SequentialDecisionPolicies\IGrammarPolicy.cs" /> 47 45 <Compile Include="SequentialDecisionPolicies\RandomPolicy.cs" /> 48 <Compile Include="SequentialDecisionPolicies\TDPolicy.cs" />49 46 <Compile Include="SolverBase.cs" /> 50 47 <Compile Include="ISolver.cs" /> 51 48 <Compile Include="Properties\AssemblyInfo.cs" /> 52 <Compile Include="Solvers\AlternativesContextSampler.cs" />53 <Compile Include="Solvers\AlternativesSampler.cs" />54 49 <Compile Include="Solvers\ExhaustiveBreadthFirstSearch.cs" /> 55 50 <Compile Include="Solvers\ExhaustiveDepthFirstSearch.cs" /> -
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.GrammaticalOptimization/SequentialDecisionPolicies/GenericFunctionApproximationGrammarPolicy.cs
r11980 r11981 60 60 originalIdx++; 61 61 } 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 */74 62 75 63 76 if (random.NextDouble() < 0.5) { 64 // TODO: policy should be a parameter of the function approximation policy 65 if (random.NextDouble() < 0.2) { 77 66 selectedStateIdx = actionIndexMap[random.Next(maxIdx)]; 78 67 } else { … … 139 128 private void UpdateWeights(string state, double reward) { 140 129 double delta = reward - GetValue(state); 141 // delta /= problem.GetFeatures(state).Count();142 //const double alpha = 0.001;143 130 foreach (var feature in problem.GetFeatures(state)) { 144 131 featureTries[feature.Id] = GetFeatureTries(feature.Id) + 1;
Note: See TracChangeset
for help on using the changeset viewer.