Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3409 for trunk


Ignore:
Timestamp:
04/19/10 10:18:15 (14 years ago)
Author:
gkronber
Message:

Worked on ADF aware evaluation for symbolic regression problems #938 (Data types and operators for regression problems)

Location:
trunk/sources
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Instruction.cs

    r3376 r3409  
    3535    Div,
    3636    Call,
     37    Arg,
    3738    Values,
    3839    Dynamic
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTree.cs

    r3376 r3409  
    4747    }
    4848
    49     public SymbolicExpressionTreeNode ResultProducingExpression {
    50       get { return root.SubTrees[0].SubTrees[0]; }
    51     }
    52 
    5349    public int Size {
    5450      get {
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeCompiler.cs

    r3376 r3409  
    3737      {typeof(Division), CodeSymbol.Div},
    3838      {typeof(InvokeFunction), CodeSymbol.Call},
     39      {typeof(Argument), CodeSymbol.Arg},
    3940      //{typeof(Values), CodeSymbol.Values}
    4041    };
     
    4546      entryPoint.Clear();
    4647      // compile main body
    47       code.AddRange(Compile(tree.ResultProducingExpression));
     48      code.AddRange(Compile(tree.Root.SubTrees[0]));
    4849      // compile branches
    4950      var functionBranches = from node in tree.IterateNodesPrefix()
     
    6768            var invokeNode = (InvokeFunctionTreeNode)node;
    6869            instr.iArg0 = entryPoint[invokeNode.Symbol.FunctionName];
     70          } else if (instr.symbol == CodeSymbol.Arg) {
     71            var argNode = (ArgumentTreeNode)node;
     72            instr.iArg0 = (short)argNode.Symbol.ArgumentIndex;
    6973          }
    7074        } else {
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs

    r3373 r3409  
    141141      SymbolicExpressionTreeCreator creator = new ProbabilisticTreeCreator();
    142142      var evaluator = new SymbolicRegressionMeanSquaredErrorEvaluator();
    143       var grammar = new ArithmeticExpressionGrammar();
     143      var grammar = new GlobalSymbolicExpressionGrammar(new ArithmeticExpressionGrammar());
    144144      Parameters.Add(new ValueParameter<BoolValue>("Maximization", "Set to false as the error of the regression model should be minimized.", new BoolValue(false)));
    145145      Parameters.Add(new ValueParameter<SymbolicExpressionTreeCreator>("SolutionCreator", "The operator which should be used to create new symbolic regression solutions.", creator));
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionEvaluator.cs

    r3377 r3409  
    4444        this.row = row;
    4545        pc = 0;
     46        arguments.Clear();
    4647        var estimatedValue = Evaluate();
    4748        if (double.IsNaN(estimatedValue) || double.IsInfinity(estimatedValue)) yield return 0.0;
     
    5051    }
    5152
     53    private List<double> arguments = new List<double>();
    5254    public double Evaluate() {
    5355      var currentInstr = code[pc++];
     
    8183            return p;
    8284          }
     85        case CodeSymbol.Call: {
     86            // save current arguments
     87            var oldArgs = new List<double>(arguments);
     88            arguments.Clear();
     89            // evaluate sub-trees
     90            for (int i = 0; i < currentInstr.nArguments; i++) {
     91              arguments.Add(Evaluate());
     92            }
     93            // save the pc
     94            int nextPc = pc;
     95            // set pc to start of function 
     96            pc = currentInstr.iArg0;
     97            // evaluate the function
     98            double v = Evaluate();
     99            // restore the pc => evaluation will continue at point after my subtrees 
     100            pc = nextPc;
     101            // restore arguments
     102            arguments = oldArgs;
     103            return v;
     104          }
     105        case CodeSymbol.Arg: {
     106            return arguments[currentInstr.iArg0];
     107          }
    83108        case CodeSymbol.Dynamic: {
    84109            var variableTreeNode = currentInstr.dynamicNode as VariableTreeNode;
  • trunk/sources/HeuristicLab/Files.x86.txt

    r2691 r3409  
    22; This file contains a list of all x86 specific files
    33
    4 HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlceca35.dll
    5 HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlcecompact35.dll
    6 HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlceer35EN.dll
    7 HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlceme35.dll
    8 HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlceoledb35.dll
    9 HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlceqp35.dll
    10 HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlcese35.dll
     4;HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlceca35.dll
     5;HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlcecompact35.dll
     6;HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlceer35EN.dll
     7;HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlceme35.dll
     8;HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlceoledb35.dll
     9;HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlceqp35.dll
     10;HeuristicLab.ExtLibs\HeuristicLab.SQLServerCompact\3.5.1.0\x86\sqlcese35.dll
    1111
    12 HeuristicLab.ExtLibs\HeuristicLab.SQLite\1.0.65.0\x86\System.Data.SQLite.dll
     12;HeuristicLab.ExtLibs\HeuristicLab.SQLite\1.0.65.0\x86\System.Data.SQLite.dll
Note: See TracChangeset for help on using the changeset viewer.