Giter VIP home page Giter VIP logo

Comments (5)

brendenpetersen avatar brendenpetersen commented on June 10, 2024 2

I'm happy to have you pick out the details for us! I think you are correct above. However, it would be much better to actually show code examples where it's providing the wrong result, instead of relying on us re-interpreting the DSO logic :)

Also, we are happy to accept pull requests for this sort of thing! I think you know exactly the changes to be made :)

from deep-symbolic-optimization.

brendenpetersen avatar brendenpetersen commented on June 10, 2024 1

You'd hit the elif when using a PlaceholderConstant because the string will be something like "4.56" (not "const"), so it adds a PlaceholderConstant to traversal.

E.g., str_tokens = ["add","4.56","x1"], where the Library has a PlaceholderConstant but not HardcodedConstant.

from deep-symbolic-optimization.

brendenpetersen avatar brendenpetersen commented on June 10, 2024
  1. In program.py we call tokens.tostring() a few times, where tokens is an np.ndarray with dtype=np.int32. This is part of the NumPy API: https://numpy.org/doc/stable/reference/generated/numpy.ndarray.tostring.html.

  2. It is correct that Program.library.const_token is None when you have HardcodedConstant and no PlaceholderConstant. However, if you have a HardcodedConstant like 1.23 in your Library, you will not hit the elif you quoted because the name of the HardcodedConstant is "1.23", so the first if will be True.

  3. Yes, it should be assert U.is_float(const).

from deep-symbolic-optimization.

TOP1RM avatar TOP1RM commented on June 10, 2024

Ok thanks for your responses (here and by email !). I just realized that I figured it out months ago for the tostring but I forgot. For the second question, I understand your answer, but then I don't see in what case you will have a float and hit the elif. But that is not a problem, as it is a case I will not encounter I believe.

I close this issue, but may reopen it whenever I have other questions !
Thanks again !

from deep-symbolic-optimization.

TOP1RM avatar TOP1RM commented on June 10, 2024

TOP1RM is coming back

Hello again, tell me if I should keep my remarks/questions for myself or gather them in order to avoid spamming your repository ! Else I may reopen this issue whenever I can't understand a line I will need (as I said before, I am studying the code, but will only work on the parts that I need).

Today, I think there might be an error in subroutines.py in the function jit_check_constraint_violation_descendant_with_target_tokens. Just below is the code sample I am suspicious about:

if a_in_b(action, effector_tokens, T):
    # Does action match a target token?
    descendant = True
    dangling = 1
elif a_in_b(action, target_tokens, T):
    if descendant:
        return True

I believe having well understood the mechanics of this function, but as I understand it, it should be something like that:

if a_in_b(action, effector_tokens, E):
    # Does action match an effector token?
    descendant = True
    dangling = 1
elif a_in_b(action, target_tokens, T):
    # Does action match a target token?
    if descendant:
        return True

And E would be equal to effector_tokens.shape[0].

Last detail, in jit_check_constraint_violation_descendant_no_target_tokens, in the first call of a_in_b, just before if descendant:, the commentary is Does action match a target tokens?. Is it because, in the context of calling this function, targets and effectors are the same?

Please accept my apologies if I am wrong.
Best regards, TOP1RM

from deep-symbolic-optimization.

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.