Closed SigmaX closed 1 year ago
Thanks Mark!
I like the idea of using reflection to eliminate the explicit arity tracking—since introducing a whole new class hierarchy like we have here for such a small optimization does rub me wrong.
I’ll open a backlog issue to track that idea.
This manually incorporates @DBraun's contribution from PR #218 into
develop
:prune
option toCGPDecoder
andCGPWithParametersDecoder
that, when True, removes dead nodes (nodes that don't contribute to a graph's output nodes). This leads to much simpler/fasternetworkx
visualizations with the CGP examples, and thecgp_images.py
example now runs some 20% faster on my machine even with visuals disabled.Primitive
base class that can optionally be used to wrap primitive functions—when used,CGPExecutable
can be a bit more efficient, by ignoring graph edges for low-arity functionsCGPWithParametersDecoder