-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement tree rotation operator #348
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to modify this so it works for unary operators too Done!
cc @foxtran – seems this new operator complements your swap operator well |
Nice! |
3fa35c9
to
90fd2dd
Compare
Benchmark Results
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
Pull Request Test Coverage Report for Build 11205280259Details
💛 - Coveralls |
This implements a tree rotation as one of the mutation operators:
Though the code implementation here also covers unary operators – both as a root and as a pivot (and as both).
As an example, the expression$$1.5 \cdot \exp(x_1) + \frac{2.5}{x_3}$$ can randomly mutate into one of: $$\frac{(1.5 \cdot \exp(x_1)) + 2.5}{x_3},$$ $$1.5 \cdot \left(\exp(x_1) + \frac{2.5}{x_3}\right),$$ or $$\exp(1.5 \cdot x_1) + \frac{2.5}{x_3},$$ .
Thanks to @larsentom for the idea.
This current implementation is a draft.From watching the learning dynamics it definitely seems to help diversify the expressions (!) but we likely want to tune the default mutation weight.NodeSampler
be able to return parent nodes. Otherwise we either need to skip root nodes or do what I do currently which is do a second tree search for the parent - which seems inefficient. But maybe it is the best strategy, I'm not sure.