Opened 2 years ago
Closed 2 weeks ago
#2985 closed defect (done)
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 e^{30} ) 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 (14)
comment:1 Changed 2 years ago by gkronber
- Milestone changed from HeuristicLab 3.3.16 to HeuristicLab 3.3.17
comment:2 Changed 4 months ago by gkronber
- Owner set to gkronber
- Status changed from new to accepted
comment:3 Changed 4 months ago by gkronber
comment:4 Changed 4 months 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: ↓ 10 Changed 4 months 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 months ago by gkronber
- Owner changed from gkronber to mkommend
- Status changed from accepted to reviewing
comment:7 Changed 3 months ago by mkommend
- Version set to trunk
comment:8 Changed 3 months ago by mkommend
r17820: changed behavior of root simplification (rootSymbol(a,0) => double.NaN) and added comments for performed simplifications.
comment:9 follow-up: ↓ 11 Changed 3 months 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.
comment:10 in reply to: ↑ 5 Changed 3 months 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.
comment:11 in reply to: ↑ 9 Changed 3 months 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 3 months ago by gkronber
- Status changed from reviewing to readytorelease
comment:13 Changed 5 weeks ago by gkronber
comment:14 Changed 2 weeks ago by gkronber
- Resolution set to done
- Status changed from readytorelease to closed
r17796 add unit tests to reproduce the problem