IBM / LNN

A `Neural = Symbolic` framework for sound and complete weighted real-value logic
https://IBM.github.io/LNN/
Apache License 2.0
226 stars 438 forks source link

FIX: Not downward operator and operands bounds sometimes doesn't match #54

Closed wqq198768 closed 1 year ago

wqq198768 commented 1 year ago

In my program, #1 and #2 genenrates different results due to different order of data. It's caused by not passing grouding_rows to bounds_aggregate function in Not downward.

1

model.add_data( { fourleg: {"D1": lnn.Fact.TRUE}, twoleg: {"A1": lnn.Fact.TRUE, "B1":lnn.Fact.TRUE}, } )

2

model.add_data( { twoleg: {"A1": lnn.Fact.TRUE, "B1":lnn.Fact.TRUE}, fourleg: {"D1": lnn.Fact.TRUE},
} )

NaweedAghmad commented 1 year ago

Nice catch! Looks like the negation was incorrectly making assumptions about the ordering by using the default None. Unfortunately I can't merge in these changes without you signing off on the DCO

@KyleErwin please make sure these changes are reflected on our side as well.

NaweedAghmad commented 1 year ago

Looks like there was some nuance that the None was encoding, that the table_rows are not. Can you please post the results for your 2 experiments, the problem may be somewhere else in the code

NaweedAghmad commented 1 year ago

since I don't have your model and can't recreate these results, I'm closing off the PR