- Timestamp:
- 10/29/17 22:22:38 (7 years ago)
- Location:
- branches/MCTS-SymbReg-2796/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MCTS-SymbReg-2796/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/Automaton.cs
r15440 r15441 440 440 int storedPC = codeGenerator.ProgramCounter; 441 441 442 if ( !IsFinalState(CurrentState)) {442 if (CurrentState != StateExprEnd) { 443 443 // save state and code, 444 444 storedState = CurrentState; … … 446 446 447 447 // take shortest route to final state (smaller state values are closer to the final state) 448 while ( !IsFinalState(CurrentState)) {448 while (CurrentState != StateExprEnd) { 449 449 Debug.Assert(followStates[CurrentState][0] == followStates[CurrentState].Min()); 450 450 var nextState = followStates[CurrentState][0]; -
branches/MCTS-SymbReg-2796/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/MctsSymbolicRegressionStatic.cs
r15440 r15441 61 61 // TODO: Solve Poly-10 62 62 // TODO: rename everything as this is not MCTS anymore 63 // TODO: After state unification the recursive backpropagation of results takes a lot of time. How can this be improved? 63 // TODO: when a path to an expression is explored first (e.g. x1 + x2) 64 // and later we find the a longer form x1 + x1 + x2 where the number of variable references 65 // exceeds the maximum in the automaton this leads to an error (see unit tests) 66 // ~~obsolete TODO: After state unification the recursive backpropagation of results takes a lot of time. How can this be improved? 64 67 // ~~obsolete TODO: Why is the algorithm so slow for rather greedy policies (e.g. low C value in UCB)? 65 68 // ~~obsolete TODO: check if we can use a quality measure with range [-1..1] in policies … … 72 75 // TODO: is it OK to initialize all constants to 1 (Obj 2)? 73 76 // TODO: improve memory usage 77 // TODO: analyze / improve perf of ExprHashing (canonical form for expressions) 74 78 // TODO: support empty test partition 75 79 // TODO: the algorithm should be invariant to linear transformations of the space (y = f(x') = f( Ax ) ) for invertible transformations A --> unit tests … … 561 565 tree = state.children[tree][selectedIdx]; 562 566 563 // move the automaton forward until reaching the state564 567 // all steps where no alternatives could be taken immediately (without expanding the tree) 565 568 // TODO: simplification of the automaton … … 669 672 670 673 private static int SelectInternal(List<Tree> list, IRandom rand) { 674 Debug.Assert(list.Any(t => !t.Done)); 675 676 // check if there is any node which has not been visited 677 for(int i=0;i<list.Count;i++) { 678 if (!list[i].Done && list[i].visits == 0) return i; 679 } 680 671 681 // choose a random node. 672 Debug.Assert(list.Any(t => !t.Done));673 674 682 var idx = rand.Next(list.Count); 675 683 while (list[idx].Done) { idx = rand.Next(list.Count); }
Note: See TracChangeset
for help on using the changeset viewer.