Giter VIP home page Giter VIP logo

Comments (9)

kstaats avatar kstaats commented on September 15, 2024

from karoo_gp.

rll2021 avatar rll2021 commented on September 15, 2024

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.

kstaats avatar kstaats commented on September 15, 2024

from karoo_gp.

kstaats avatar kstaats commented on September 15, 2024

from karoo_gp.

ducktalez avatar ducktalez commented on September 15, 2024

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.

rll2021 avatar rll2021 commented on September 15, 2024

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.

rll2021 avatar rll2021 commented on September 15, 2024

AskAsk:
Sorry for confusing things with my previous comment.
The action is for you to take.

  • Richard

from karoo_gp.

asksak avatar asksak commented on September 15, 2024

AskAsk:
Sorry for confusing things with my previous comment.
The action is for you to take.

  • Richard

will look into it

from karoo_gp.

asksak avatar asksak commented on September 15, 2024

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:

base_class.py.zip

I zipped the file and attached it here.

  1. I used rll2021 base class mod, and modified any other file he had regarding the issue he raised, works like magic.
  2. I added MAX and MIN
  3. 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):

log_test2.txt.zip

I will clean up all the files once I finish adding my mods.

Best,

Aymen

from karoo_gp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.