Why does tree conditions stopped working #519
-
Right now, I have custom_objective, where right part of a tree is divided into to parts: left ( I need to calculate derivative of this tree, but I have to change it; to look like Why can this problem occur?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think you need - power.constant != true && return L(Inf)
+ (power.degree != 0 || power.constant != true) && return L(Inf) because the Also one other tip is that rather than returning Also I would do eval_power = power.val::T for improved speed |
Beta Was this translation helpful? Give feedback.
I think you need
because the
.constant
field is some random value if it's an operator node. So for it to be a constant node it has to be.degree == 0
AND.constant == true
.Also one other tip is that rather than returning
L(Inf)
for all of the constraints, you should return lesser and lesser penalties so that the evolutionary algorithm gets a sense of direction. e.g., for the firstL(Inf)
, make itL(100_000)
(since that is the most important constraint to get right). The secondL(Inf)
, make itL(50_000)
, since at least then it got the first constraint. ThenL(25_000)
. And so on.