logic-and-learning-lab/Popper

Noise handling

JeanChristopheRohner opened this issue · 4 comments

Thanks for making Popper!

An extra feature i would find useful is the ability to handle noise. I tried this but i get no theory.

bias.pl

max_vars(3).
max_body(2).

head_pred(grandparent,2).
body_pred(parent,2).

bk.pl

parent(abe,homer).
parent(homer,lisa).
parent(homer,bart).
parent(clancy,marge).
parent(marge,maggy).
parent(marge,lisa).
parent(marge, bart).

exs.pl

pos(grandparent(abe,bart)).
pos(grandparent(abe,lisa)).
pos(grandparent(clancy,lisa)).
pos(grandparent(clancy,bart)).
neg(grandparent(homer,bart)).
neg(grandparent(abe,homer)).
neg(grandparent(homer,bart)).
neg(grandparent(bart,lisa)).
neg(grandparent(clancy,maggy)). % noise

Hi @JeanChristopheRohner, yes, this feature would be great. We will look to add it in the next 1-3 months.

@JeanChristopheRohner this feature is now working. Please try running Popper (currently from the main branch) with the--noisy flag.

hakank commented

@andrewcropper Is JCR's example expected to work with v3.0.0? When I run the example with the --noisy flag (and without max_vars/3 and max_body/2 in bias.pl) , there's no solution:

$ time python popper.py hakank/jcr1 --noisy
08:11:32 Generating programs of size: 2
08:11:32 Generating programs of size: 3
08:11:32 Generating programs of size: 4
08:11:32 Generating programs of size: 5
08:11:32 Generating programs of size: 6
NO SOLUTION

Please note that the noisy* examples in examples/ works with the --noisy flag, so it's not a general problem, just for this specific example.

My environment:

  • Linux Ubuntu 20.05LTS
  • Popper: main version (per 2023-11-01)
  • Python: 3.9.4
  • SWI-Prolog: 9.0.4
  • pyswipl: main version
  • pysat: python-sat 0.1.8.dev10