- Timestamp:
- 03/08/16 20:10:16 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/MctsSymbolicRegressionAlgorithm.cs
r13658 r13669 209 209 Results.Add(new Result("Iterations", iterations)); 210 210 211 var bestSolutionIteration = new IntValue(0); 212 Results.Add(new Result("Best solution iteration", bestSolutionIteration)); 213 211 214 var table = new DataTable("Qualities"); 212 215 table.Rows.Add(new DataRow("Best quality")); … … 261 264 double bestQ = 0.0; 262 265 double curBestQ = 0.0; 263 double q = 0.0;264 266 int n = 0; 265 267 // Loop until iteration limit reached or canceled. … … 267 269 cancellationToken.ThrowIfCancellationRequested(); 268 270 269 q = MctsSymbolicRegressionStatic.MakeStep(state);271 var q = MctsSymbolicRegressionStatic.MakeStep(state); 270 272 sumQ += q; // sum of qs in the last updateinterval iterations 271 273 curBestQ = Math.Max(q, curBestQ); // the best q in the last updateinterval iterations … … 274 276 // iteration results 275 277 if (n == updateInterval) { 278 if (bestQ > bestQuality.Value) { 279 bestSolutionIteration.Value = i; 280 } 276 281 bestQuality.Value = bestQ; 277 282 curQuality.Value = curBestQ; … … 295 300 // final results 296 301 if (n > 0) { 302 if (bestQ > bestQuality.Value) { 303 bestSolutionIteration.Value = iterations.Value + n; 304 } 297 305 bestQuality.Value = bestQ; 298 306 curQuality.Value = curBestQ; -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/MctsSymbolicRegressionStatic.cs
r13658 r13669 418 418 } 419 419 } 420 // no final state -> select a randomchild420 // no final state -> select a the first child 421 421 if (selectedChildIdx == -1) { 422 selectedChildIdx = rand.Next(tree.children.Length);422 selectedChildIdx = 0; 423 423 } 424 424 return tree.children[selectedChildIdx]; -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/Policies/EpsGreedy.cs
r13662 r13669 9 9 using HeuristicLab.Data; 10 10 using HeuristicLab.Parameters; 11 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 11 12 12 13 namespace HeuristicLab.Algorithms.DataAnalysis.MctsSymbolicRegression.Policies { 14 [StorableClass] 13 15 [Item("EpsilonGreedy", "Epsilon greedy policy with parameter eps to balance between exploitation and exploration")] 14 16 public class EpsilonGreedy : PolicyBase { … … 30 32 } 31 33 34 [StorableConstructor] 35 protected EpsilonGreedy(bool deserializing) : base(deserializing) { } 32 36 protected EpsilonGreedy(EpsilonGreedy original, Cloner cloner) 33 37 : base(original, cloner) { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/Policies/PolicyBase.cs
r13661 r13669 16 16 17 17 [StorableConstructor] 18 pr ivatePolicyBase(bool deserializing) : base(deserializing) { }18 protected PolicyBase(bool deserializing) : base(deserializing) { } 19 19 protected PolicyBase(PolicyBase original, Cloner cloner) 20 20 : base(original, cloner) { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/Policies/Ucb.cs
r13662 r13669 9 9 using HeuristicLab.Data; 10 10 using HeuristicLab.Parameters; 11 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 11 12 12 13 namespace HeuristicLab.Algorithms.DataAnalysis.MctsSymbolicRegression.Policies { 14 [StorableClass] 13 15 [Item("Ucb Policy", "Ucb with parameter c to balance between exploitation and exploration")] 14 16 public class Ucb : PolicyBase { … … 30 32 } 31 33 34 [StorableConstructor] 35 protected Ucb(bool deserializing) : base(deserializing) { } 32 36 protected Ucb(Ucb original, Cloner cloner) 33 37 : base(original, cloner) { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/Policies/UcbTuned.cs
r13662 r13669 9 9 using HeuristicLab.Data; 10 10 using HeuristicLab.Parameters; 11 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 11 12 12 13 namespace HeuristicLab.Algorithms.DataAnalysis.MctsSymbolicRegression.Policies { 14 [StorableClass] 13 15 [Item("UcbTuned Policy", "UcbTuned is similar to Ucb but tracks empirical variance. Use parameter c to balance between exploitation and exploration")] 14 16 public class UcbTuned : PolicyBase { … … 32 34 } 33 35 36 [StorableConstructor] 37 protected UcbTuned(bool deserializing) : base(deserializing) { } 34 38 protected UcbTuned(UcbTuned original, Cloner cloner) 35 39 : base(original, cloner) {
Note: See TracChangeset
for help on using the changeset viewer.