Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/13/14 13:03:24 (10 years ago)
Author:
bburlacu
Message:

#1772: HeuristicLab.Problems.DataAnalysis.Symbolic:

  • Merged trunk changes (SymbolicExpressionImporter)
  • Added Passthrough symbol (does not perform an operation, just transfers the input), adjusted interpreter and opcodes accordingly
  • Added diversity preserving crossover
  • Replaced IDistanceCalculator interface with ISymbolicDataAnalysisExpressionSimilarityCalculator and adjusted similarity calculators
  • Refactored tracing, moved functionality to the TraceCalculator (when this is complete the old code will be removed)
Location:
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4

    • Property svn:ignore
      •  

        old new  
        55TreeDistance
        66SymbolicDataAnalysisExpressionTreeMatching.cs
         7Importer
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs

    r11208 r11458  
    2323using System.Collections.Generic;
    2424using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     25using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
    2526
    2627namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    8384    public const byte Erf = 43;
    8485    public const byte Bessel = 44;
     86    public const byte Passthrough = 45;
    8587
    8688    private static Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() {
     
    130132      { typeof(Norm), OpCodes.Norm},
    131133      { typeof(Erf), OpCodes.Erf},
    132       { typeof(Bessel), OpCodes.Bessel}   
     134      { typeof(Bessel), OpCodes.Bessel},
     135      { typeof(Passthrough), OpCodes.Passthrough}
    133136    };
    134137
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs

    r11232 r11458  
    111111
    112112      var code = SymbolicExpressionTreeLinearCompiler.Compile(tree, OpCodes.MapSymbolToOpCode);
     113      PrepareInstructions(code, dataset);
     114      return rows.Select(row => Evaluate(dataset, row, code));
     115    }
     116
     117    // NOTE: do not use this method when evaluating trees. this method is provided as a shortcut for evaluating subtrees ad-hoc
     118    public IEnumerable<double> GetValues(ISymbolicExpressionTreeNode node, Dataset dataset, IEnumerable<int> rows) {
     119      var code = SymbolicExpressionTreeLinearCompiler.Compile(node, OpCodes.MapSymbolToOpCode);
    113120      PrepareInstructions(code, dataset);
    114121      return rows.Select(row => Evaluate(dataset, row, code));
     
    329336          state.Reset();
    330337          instr.value = interpreter.Evaluate(dataset, ref row, state);
     338        } else if (instr.opCode == OpCodes.Passthrough) {
     339          instr.value = code[instr.childIndex].value;
    331340        } else {
    332341          var errorText = string.Format("The {0} symbol is not supported by the linear interpreter. To support this symbol, please use the SymbolicDataAnalysisExpressionTreeInterpreter.", instr.dynamicNode.Symbol.Name);
Note: See TracChangeset for help on using the changeset viewer.