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

Greater_than Primitive for real numbers #83

Open
madhavk98 opened this issue Aug 3, 2021 · 0 comments
Open

Greater_than Primitive for real numbers #83

madhavk98 opened this issue Aug 3, 2021 · 0 comments

Comments

@madhavk98
Copy link

Hi I am trying to use dreamcoder to classify images. Given 2 floating-point numbers extracted from the image (distance_between_two_objects and object_density_in_fixed_radius), I am trying to classify the image as True or False. To do this, I want the system to discover an algebraic expression for an interaction feature between the two given variables, such that it is able to classify True or False depending on if that interaction feature is above a (discovered) threshold or not.

So far, to achieve this, I am using f0, f1, fpi, real_power, real_subtraction, real_addition, real, real_division, real_multiplication features from scientific_Laws.py. For the final step, I want to introduce a feature real_greater_than which is the same as primitive_greater_than in program.ml. However, when I do that (by simply changing int in primitive_greater_than to float), doing make clean and makeand adding the lines: real_greater_than = Primitive(">.", arrow(treal, treal, tbool), _greater_than)
and def _greater_than(x): return lambda y: x > y to the code, I get the following error at runtime:

Screen Shot 2021-08-03 at 6 37 26 PM

Would greatly appreciate any help, thanks!

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