Skip to content

Why does tree conditions stopped working #519

Answered by MilesCranmer
DenisSvirin asked this question in Q&A
Discussion options

You must be logged in to vote

I think you need

-    power.constant != true && return L(Inf)
+    (power.degree != 0 || power.constant != true) && return L(Inf)

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 first L(Inf), make it L(100_000) (since that is the most important constraint to get right). The second L(Inf), make it L(50_000), since at least then it got the first constraint. Then L(25_000). And so on.


Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DenisSvirin
Comment options

Answer selected by DenisSvirin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
SymbolicRegression.jl SymbolicRegression.jl-related discussion
2 participants