Opened 2 years ago

Last modified 12 days ago

#2985 readytorelease defect

TreeSimplifier simplifies non-constant subtrees to constant

Reported by: lkammere Owned by: gkronber
Priority: medium Milestone: HeuristicLab 3.3.17
Component: Problems.DataAnalysis.Symbolic Version: trunk
Keywords: Cc:

Description

In the tree below, the exponentiation factor becomes very large (about e30 ) while the other factor (5,5606E-016) shrinks this output down into a valid range. However, in the simplifier, this is reduced to a constant, because (5,5606E-016) is too small. The values of Variable X1 are in the range of 0,2 and 1.0

   (Addition
      (5,9323E-002)
      (Multiplication
        (5,5606E-016)
        (Exponential
          (3,5861E+001 X1)
        )
      )
    )

Change History (12)

comment:1 Changed 21 months ago by gkronber

  • Milestone changed from HeuristicLab 3.3.16 to HeuristicLab 3.3.17

comment:2 Changed 4 weeks ago by gkronber

  • Owner set to gkronber
  • Status changed from new to accepted

comment:3 Changed 4 weeks ago by gkronber

r17796 add unit tests to reproduce the problem

comment:4 Changed 4 weeks ago by gkronber

r17797: removed all usages of IsAlmost from TreeSimplifier (+ minor rearrangement of operands in unit test to match the actual output).

comment:5 follow-up: Changed 4 weeks ago by gkronber

I decided to remove all usages of IsAlmost() from the simplifier to make sure we do not lose relevant parts of the sub-tree on simplification.

The matching is now exact (except for Root and Power which round the exponent in the same way as our interpreters). The drawback is that we may keep sub-trees which are almost irrelevant, resulting in larger trees after simplification.

The change breaks reproduceability. However, it seems the only case where this has an effect is if you load an old experiment where you selected and simplified a SymReg model and you simplify the same model again.

It can lead to completely different results for custom algorithms which simplified trees within the population. However, out-of-the-box no algorithm in HeuristicLab did that so far.

comment:6 Changed 4 weeks ago by gkronber

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

comment:7 Changed 12 days ago by mkommend

  • Version set to trunk

comment:8 Changed 12 days ago by mkommend

r17820: changed behavior of root simplification (rootSymbol(a,0) => double.NaN) and added comments for performed simplifications.

comment:9 follow-up: Changed 12 days ago by mkommend

  • Owner changed from mkommend to gkronber

Reviewed r17797 and everything works as expected.

An error has been present in the simplifier, specifically root(a,0) has been simplified to 1.0. However, the 0-th root is undefined (math-exchange). This has been changed with r17820, which has to be reviewed again.

Last edited 12 days ago by mkommend (previous) (diff)

comment:10 in reply to: ↑ 5 Changed 12 days ago by mkommend

Replying to gkronber:

The change breaks reproduceability. However, it seems the only case where this has an effect is if you load an old experiment where you selected and simplified a SymReg model and you simplify the same model again.

It can lead to completely different results for custom algorithms which simplified trees within the population. However, out-of-the-box no algorithm in HeuristicLab did that so far.

This is completely fine and should not bother us at all.

Last edited 12 days ago by gkronber (previous) (diff)

comment:11 in reply to: ↑ 9 Changed 12 days ago by gkronber

Replying to mkommend:

An error has been present in the simplifier, specifically root(a,0) has been simplified to 1.0. However, the 0-th root is undefined (math-exchange). This has been changed with r17820, which has to be reviewed again.

Well-spotted. Reviewed r17820

comment:12 Changed 12 days ago by gkronber

  • Status changed from reviewing to readytorelease
Note: See TracTickets for help on using tickets.