Opened 4 years ago

Closed 4 years ago

#2021 closed enhancement (done)

SymbolicExpressionTreeLinearInterpreter

Reported by: bburlacu Owned by: gkronber
Priority: low Milestone: HeuristicLab 3.3.9
Component: Problems.DataAnalysis.Symbolic Version: 3.3.9
Keywords: Cc:

Description (last modified by bburlacu)

Initial tests show that a linear interpreter (as in, non-recursive) can bring up to a 20% increase in speed when using the type coherent grammar.

Initial implementation supports all symbols except time-lagged symbols of any kind (Integral, Derivative, TimeLag) and ADFs.

linear interpreter schema

Attachments (1)

linear_interpreter.png (114.6 KB) - added by bburlacu 4 years ago.
linear interpreter schema

Download all attachments as: .zip

Change History (38)

comment:1 Changed 4 years ago by bburlacu

r9271: Initial implementation of the SymbolicDataAnalysisExpressionTreeLinearInterpreter.

comment:2 Changed 4 years ago by bburlacu

  • Description modified (diff)

comment:3 Changed 4 years ago by bburlacu

  • Description modified (diff)

comment:4 Changed 4 years ago by bburlacu

  • Description modified (diff)

comment:5 Changed 4 years ago by bburlacu

  • Status changed from new to assigned

comment:6 Changed 4 years ago by bburlacu

r9290: Removed double field from Instruction.cs, added separated double array for computing the values.

Last edited 4 years ago by bburlacu (previous) (diff)

comment:7 Changed 4 years ago by bburlacu

r9292: Reverted r9290 as it is actually slower than the initial implementation.

comment:8 Changed 4 years ago by bburlacu

r9732: Merged trunk changes for HeuristicLab.Encodings.SymbolicExpressionTreeEncoding and HeuristicLab.Problems.DataAnalysis.Symbolic. Replaced prefix iteration of nodes in the linear interpretation with breadth iteration for simplified logic and extra performance. Reversed unnecessary changes to other projects.

comment:9 Changed 4 years ago by bburlacu

r9733: Fixed wrong method invocation in SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs.

comment:10 Changed 4 years ago by bburlacu

r9734: Updated license year, fixed interpreter name (SymbolicDataAnalysisExpressionTreeLinearInterpreter) and updated description. Replaced tabs with spaces in Instruction.cs.

comment:11 Changed 4 years ago by bburlacu

r9735: Forgot to add tests subproject to the solution.

comment:12 Changed 4 years ago by bburlacu

  • Status changed from assigned to accepted

r9738: Created separate LinearInstruction class for the linear interpreter. Added properties folder and strong name key.

comment:13 Changed 4 years ago by gkronber

Please accept this ticket. I'd be happy if we can integrate your changes into the trunk soon.

Changed 4 years ago by bburlacu

linear interpreter schema

comment:14 Changed 4 years ago by bburlacu

r9739: Added separate SymbolicExpressionTreeLinearCompiler. Updated the SymbolicDataAnalysisExpressionTreeLinearInterpreter:

  • moved constants evaluation outside of loop
  • simplified code
  • renamed EvaluateFast method to Evaluate and made it static.

comment:15 Changed 4 years ago by bburlacu

  • Milestone changed from HeuristicLab 3.3.x Backlog to HeuristicLab 3.3.9
  • Owner changed from bburlacu to mkommend
  • Status changed from accepted to reviewing

r9758:

  • Derived the LinearInstruction class from Instruction.
  • Added missing symbols to the linear interpreter
  • Changed description for the linear interpreter
  • Added more helpful exception message when a symbol is not supported.
  • Added evaluation test for the linear interpreter

comment:16 Changed 4 years ago by bburlacu

r9776: Added support for lagged symbols: TimeLag, Derivative, Integral.

comment:17 Changed 4 years ago by bburlacu

r9788: Fixed evaluation bug for LaggedVariable symbols.

comment:18 Changed 4 years ago by bburlacu

r9793: Small code improvements.

comment:19 Changed 4 years ago by bburlacu

r9815: Code enhancements: changed the SymbolicExpressionTreeLinearCompiler to use and return an array directly and not a list.ToArray(). Replaced GetPrefixSequence lambda with a standalone method and eliminated SetSkip lambda from the PrepareInstructions method. Updated description of SymbolicDataAnalysisExpressionTreeLinearInterpreter.

comment:20 Changed 4 years ago by bburlacu

r9818: Changed Evaluate method to pass the row parameter by value and not by reference.

comment:21 Changed 4 years ago by mkommend

r9826: Minor code changes in the linear interpreter branch.

comment:22 Changed 4 years ago by mkommend

r9828: Integrated the linear interpreter in the trunk and restructed interpreter unit tests.

comment:23 Changed 4 years ago by mkommend

  • Owner changed from mkommend to gkronber
  • Version changed from branch to 3.3.9

r9830: Set the linear interpreter as default for symbolic data analysis problems.

comment:24 Changed 4 years ago by mkommend

r9831: Deleted the linear interpreter branch.

comment:25 Changed 4 years ago by bburlacu

r9837: Removed SymbolicDataAnalysisSolutionValuesCalculator.cs file that was accidentally copied into the trunk when the linear interpreter was integrated.

comment:26 Changed 4 years ago by mkommend

  • Owner changed from gkronber to mkommend
  • Status changed from reviewing to assigned

comment:27 Changed 4 years ago by mkommend

  • Status changed from assigned to accepted

A bug was detected in the node impact calculation. The tree length is not calculated correctly and as the linear interpreter uses the tree length to allocate the instructions array, it crashes.

comment:28 Changed 4 years ago by mkommend

  • Owner changed from mkommend to bburlacu
  • Status changed from accepted to reviewing

r9840: Fixed a bug node impact caluclation code and adapted the cloner to include a method to get the matching cloned object given the original one.

comment:29 Changed 4 years ago by bburlacu

r9871: Replaced the opcode switch block in the Evaluate() method with an if-else block, as it apparently improves performance.

comment:30 Changed 4 years ago by mkommend

  • Owner changed from bburlacu to gkronber

comment:31 Changed 4 years ago by gkronber

  • Owner changed from gkronber to mkommend
  • Status changed from reviewing to readytorelease

I think this is ready to be included into stable.

comment:32 Changed 4 years ago by gkronber

  • Owner changed from mkommend to gkronber
  • Status changed from readytorelease to reviewing

Pulled from release because of unresolved issues (see #1508)

comment:33 follow-up: Changed 4 years ago by gkronber

  • Owner changed from gkronber to mkommend

r9944 made fix in the way how the breath-first linear representation of the tree is translated to the prefix representation. Please review.

comment:34 in reply to: ↑ 33 Changed 4 years ago by bburlacu

Replying to gkronber:

r9944 made fix in the way how the breath-first linear representation of the tree is translated to the prefix representation. Please review.

There was indeed a bug in the code there. Your fix looks good to me.

comment:35 Changed 4 years ago by mkommend

  • Owner changed from mkommend to gkronber
  • Status changed from reviewing to readytorelease

Reviewed r9944. Thx for spotting this bug.

comment:36 Changed 4 years ago by gkronber

r9976: merged linear interpreter for symbolic data analysis solutions to stable (r9828,r9830,r9837,r9840,r9871,r9944)

comment:37 Changed 4 years ago by gkronber

  • Resolution set to done
  • Status changed from readytorelease to closed
Note: See TracTickets for help on using tickets.