DEAP GP: Can generated functions use inputs more than once?

48 views
Skip to first unread message

Randy Olson

unread,
Sep 9, 2015, 5:42:34 PM9/9/15
to deap-users
Hello,

I'm using DEAP to create a GP algorithm that evolves functions that works on a single input. So far, I've only seen functions evolve that use the input, "ARG0," only once. Is it possible for functions to evolve that use the same input multiple times in a function? e.g., add(ARG0, sub(ARG0, 5)). Do I need to set a special parameter for that, or should I just pass the same input multiple times (as ARG0, ARG1, etc.)?

Best regards,
Randy Olson

Marc-André Gardner

unread,
Sep 9, 2015, 6:00:33 PM9/9/15
to deap-users
Hi,

DEAP should be able to use an argument multiple times out-of-the-box. Basically, when a tree is generated, DEAP chooses a random terminal to put as a leaf. By definition, it may (or may not) choose the same terminal twice or more in the same tree.

I would suggest you to increase the height of the generated trees; if you're still getting only one instance of each argument, then post your code on Gist and ask for help here, I'll be pleased to help you figure that out.

Marc-André
Reply all
Reply to author
Forward
0 new messages