Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15441


Ignore:
Timestamp:
10/29/17 22:22:38 (6 years ago)
Author:
gkronber
Message:

#2796 more bug fixing

Location:
branches/MCTS-SymbReg-2796
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/MCTS-SymbReg-2796/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/Automaton.cs

    r15440 r15441  
    440440      int storedPC = codeGenerator.ProgramCounter;
    441441
    442       if (!IsFinalState(CurrentState)) {
     442      if (CurrentState != StateExprEnd) {
    443443        // save state and code,
    444444        storedState = CurrentState;
     
    446446
    447447        // take shortest route to final state (smaller state values are closer to the final state)
    448         while (!IsFinalState(CurrentState)) {
     448        while (CurrentState != StateExprEnd) {
    449449          Debug.Assert(followStates[CurrentState][0] == followStates[CurrentState].Min());
    450450          var nextState = followStates[CurrentState][0];
  • branches/MCTS-SymbReg-2796/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/MctsSymbolicRegressionStatic.cs

    r15440 r15441  
    6161    // TODO: Solve Poly-10
    6262    // 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?
    6467    // ~~obsolete TODO: Why is the algorithm so slow for rather greedy policies (e.g. low C value in UCB)?
    6568    // ~~obsolete TODO: check if we can use a quality measure with range [-1..1] in policies
     
    7275    // TODO: is it OK to initialize all constants to 1 (Obj 2)?
    7376    // TODO: improve memory usage
     77    // TODO: analyze / improve perf of ExprHashing (canonical form for expressions)
    7478    // TODO: support empty test partition
    7579    // TODO: the algorithm should be invariant to linear transformations of the space (y = f(x') = f( Ax ) ) for invertible transformations A --> unit tests
     
    561565          tree = state.children[tree][selectedIdx];
    562566
    563           // move the automaton forward until reaching the state
    564567          // all steps where no alternatives could be taken immediately (without expanding the tree)
    565568          // TODO: simplification of the automaton
     
    669672
    670673    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
    671681      // choose a random node.
    672       Debug.Assert(list.Any(t => !t.Done));
    673 
    674682      var idx = rand.Next(list.Count);
    675683      while (list[idx].Done) { idx = rand.Next(list.Count); }
  • branches/MCTS-SymbReg-2796/Tests/HeuristicLab.Algorithms.DataAnalysis-3.4/MctsSymbolicRegressionTest.cs

    r15440 r15441  
    14421442      // some Keijzer problem instances have very large test partitions (here we are not concerened about test performance)
    14431443      if (regProblem.TestPartition.End - regProblem.TestPartition.Start > 1000) regProblem.TestPartition.End = regProblem.TestPartition.Start + 1000;
    1444       TestMcts(regProblem, maxVariableReferences: 20, allowExp: false, allowLog: false, allowInv: true);
     1444      TestMcts(regProblem, maxVariableReferences: 10, allowExp: false, allowLog: false, allowInv: true);
    14451445    }
    14461446
Note: See TracChangeset for help on using the changeset viewer.