ShuhuaGao / geppy

A framework for gene expression programming (an evolutionary algorithm) in Python
https://geppy.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
207 stars 76 forks source link

what is the difference of GP and GEP in Engineering(running)? #34

Closed LJingnan closed 3 years ago

LJingnan commented 3 years ago

It that running GEP require less RAM that GP

ShuhuaGao commented 3 years ago

I am not sure about the RAM, but GEP probably takes less memory thanks to its linear representation if you write the code well. Of course, geppy here does not focus on memory saving. Generally, unless your dataset is huge, the memory consumption should not be a problem.

For other cons and pros of GEP and GP, you'd better refer to technical papers. My feeling is that the search efficiency of GEP is higher than a naive tree-structure GP.

LJingnan commented 3 years ago

“My feeling is that the search efficiency of GEP is higher than a naive tree-structure GP.” Yes, I totally agree, but this is the case when every operation is legal. But in my field, some operation is illegal and I assign a score of big negative to these operation, which cause unefficiency, I am going to rewrite the mutate and initrepeat function so that when a new gene is generated, test its score first and if the score is nan, then repeat until not.

ShuhuaGao commented 3 years ago

test its score first

Another way is to test directly whether the gene is valid according to your predefined rule (if any). However, if it is not too difficult to get valid individuals via natural evolution, there seems to be no need to intervene manually.

An even more efficient way is to design custom mutation and crossover operators that can always produce valid individuals (if it is possible), i.e., preprocess vs postprocess.

DanShai commented 3 years ago

I did a similar attempt years ago I called it Genome Network . I didnt know that GEP and CGP names exist ! thanx for the explanation and the repos! I will take a look.