-
Notifications
You must be signed in to change notification settings - Fork 12
Example for using grammatical evolution #23
Comments
Hi, I've been going through, re-doing the documentation over the last week or so, so I haven't quite had time to cover GE yet, but I shall get onto that next. Grammars can be specified as a string, which is interpreted as a BNF and parsed accordingly. I don't think it's as pretty as Abe Schneider's code at the moment, but I'll see what I can do to improve that (https://github.com/abeschneider/GrammaticalEvolution). Wallace produces an Expr along the way, but leaves the user with an anonymous function. I've done a lot of work on optimising the performance of tree-based GP, not so quite so much on GE, so I'll have a look into that next. I think the interesting differences in Wallace are:
If you have any thoughts or ideas, I would love to hear them. Thanks, Chris |
Okay dokay, I've nearly finished re-implementing GE, adding support for some of the nicer EBNF rules (AND, OR, ?, +, *). Like Abe's code, the new version operates directly on Expr objects, rather than deriving strings and later parsing them (which takes up a lot of the evaluation time). There are a few other tricks in there which speed things up, and also, you can write actual Julia code, without having to specify Expr objects directly, which makes evolving more complex code much easier.
becomes...
Annoyingly, Julia doesn't perform any of its excellent type-specific optimisations on dynamically evaluated lambda functions, and so the functions that result from an What kind of thing are you thinking of evolving with this, if you don't mind me asking? |
Wow, thanks for the quick response (and moving the code forward so quickly)! |
Hello,
I can't seem to find an example in the docs showing how to use Wallace for grammatical evolution. For example, how do you specify the grammar (And rules, Or rules, etc.)
Does it produce an Expr at the end?
Thanks!
The text was updated successfully, but these errors were encountered: