Avoid variables in power #171
-
Hi there! I'm getting used to the syntax and features of PySR and think it's excellent! One issue I'm having is with setting constraints on the power law. I wouldn't mind having a result (e.g. Also, could someone shed light on what the numbers actually represent? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @python-ista!
One thing you could try is to set Cheers, |
Beta Was this translation helpful? Give feedback.
Hi @python-ista!
(-1, 1)
means that the left argument (inpow
, this is the base) can have arbitrarily large complexity, while the1
signifies that the right argument can only have complexity of at most 1. By default, all operators, variables, and constants have a complexity of 1. The total complexity of an expression is computed but summing the individual complexities.One thing you could try is to set
complexity_of_variables=2
which, along withconstraints={"pow": (-1, 1)}
, would prevent variables appearing in the exponent while still allowing constants.Cheers,
Miles