Comments (9)
from karoo_gp.
In attempting to implement if/then/else with the architecture we have, I encounter the problem of NOT WYSIWYG. That is, we send our expressions to Sympy for presentation to the user. When Sympy receives an expression "x if a else y", it evaluates the conditional as part of its automatic simplification. So, the user never sees a conditional expression until looking at the final .csv files. That strikes me as unacceptable.
from karoo_gp.
from karoo_gp.
from karoo_gp.
Heyo! I have had this problem some long time ago and solved it by extending sympy. Maybe I have some documentation anywhere.
For now, i used the following technique:
Operator name: βIfteβ (First letter capitalized, because needs to be the same name as the class)
TensorFlow: tf.compat.v2.where
class Ifte(Function):
nargs = 3
is_Function = True
is_real = True
@classmethod
def eval(cls, a, b, c):
if a.is_Boolean:
return b if a else c # search for 'gotcha' in https://docs.sympy.org/latest/_modules/sympy/core/relational.html
else:
return
def _sympy_(self, *args):
return eval(self, *args)
Can be called with:
sympify(sympify(expr_raw, locals={'Ifte': Ifte}))
(Sympification had/has a bug, see sympy/sympy#17785)
If you want, I can also provide more information.
from karoo_gp.
Kai,
I don't know what 'pull from SIMOC' means, but I could branch from Master and you could compare from there.
from karoo_gp.
AskAsk:
Sorry for confusing things with my previous comment.
The action is for you to take.
- Richard
from karoo_gp.
AskAsk:
Sorry for confusing things with my previous comment.
The action is for you to take.
- Richard
will look into it
from karoo_gp.
Good to hear from you again. When you attach files, they come through a bit whonky. Can you instead pull from SIMOC via github, such that I can compare the your revised code to the Master branch, and test a clone of your work? Cheers, kai
β¦
Hello Kai,
I have no idea how to pull from SIMOC.
but does attach work:
I zipped the file and attached it here.
- I used rll2021 base class mod, and modified any other file he had regarding the issue he raised, works like magic.
- I added MAX and MIN
- I added self.fx_data_params_writeX() which allows continuous updating of a file that shows fitness optimization during the run, example below for classification up to 261, reached 190 so far (mod updates a file log_test2.txt in runs):
I will clean up all the files once I finish adding my mods.
Best,
Aymen
from karoo_gp.
Related Issues (20)
- Redo Tensorflow Comparison properly (CPU vs GPU)
- Conditionals and Logical Operators HOT 1
- Sporadic `ERROR! In fx_evolve_grow_mutate: branch_depth -1 < 0` HOT 6
- Add a machine-parsable `log_test.json` HOT 1
- Tensorflow v2 behaviour HOT 2
- tf.map_fn in population.py problem HOT 2
- Tensorflow meta-issue HOT 13
- Error HOT 9
- Tree Error! HOT 1
- Latest KarooGP Issues
- Functions that produce nan/inf values HOT 7
- Use joblib to use multithreading/multiprocessing computing
- Use ncurses for display HOT 1
- Switch tree navigation from breadth-first to depth-first HOT 3
- Logic & Comparison HOT 3
- Error HOT 6
- Karoo 3.0 meta-issue HOT 2
- Sympy & Numpy Issue HOT 3
- Fittest tree issue HOT 4
- TypeError: '<' not supported between instances of 'GreaterThan' and 'GreaterThan' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karoo_gp.