ellisk42/ec

Greater_than Primitive for real numbers

madhavk98 opened this issue · 0 comments

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!