Skip to content
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

Latest KarooGP Issues #81

Open
asksak opened this issue Jun 30, 2022 · 0 comments
Open

Latest KarooGP Issues #81

asksak opened this issue Jun 30, 2022 · 0 comments

Comments

@asksak
Copy link

asksak commented Jun 30, 2022

Hello Kai,

I tested the latest version of KarooGP. It seems it runs for arithmetic operators only at the moment, however, slick and fast as never before. Brilliant progress. Math and Logic are not supported as far as my test shows.

Now, as I have already converted the original KarooGP to work with all operators, I suggest the following:

1. For logical operators I used this:

ifgreaterthan(a,b)

This is mapped to tf.math.greater, otherwise order of operations does not work in sympify as it does sporadic evaluations even when EVALUATE is set to FALSE.

2. For arithmetic and math operators I used one of two:

addK(a,b) etc... where addK is a string that tensorflow is set to map it to tf.math.add
or
a+b

both work fine, but the first works flawlessly. Something to think about.

3. For Logical evaluations:

Since the result of a full logical tree will be 1 or 0, the fastest way was to cast the final result of the evaluation to float, so I did not have to modify anything else in the code.

In fx_fitness_node_parse #Do this

elif isinstance(node, ast.Call):
#print("()")
return tf.cast(operators[node.func.id](*[self.fx_fitness_node_parse(arg, tensors) for arg in node.args]), tf.float32)

NOTE: My version of KarooGP works flawlessly with all operators including logic, however, long equations with brackets take forever to crossover. Therefore, the current development process is clearly overcoming the biggest problem.

I hope the team get some good insight into some possible options.

Best,

Aymen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant