Popper icon indicating copy to clipboard operation
Popper copied to clipboard

Noise handling

Open JeanChristopheRohner opened this issue 2 years ago • 1 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

JeanChristopheRohner avatar Jun 25 '22 21:06 JeanChristopheRohner

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

andrewcropper avatar Jul 04 '22 13:07 andrewcropper

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

andrewcropper avatar Oct 28 '23 12:10 andrewcropper

@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

hakank avatar Nov 01 '23 07:11 hakank

Hi Hakan,

The noise tolerent version of Popper (with —noisy) works by learning a solution with the minimal description length, i.e. it tries to find a program that optimally compresses the examples.

In JCR’s example, it is simpler to say that everything is true and then only send the misclassified negative examples. However, it is not obvious to a user that Popper suggests such a theory. I will talk with Céline to see what we can do to make it clearer.

Thanks for pointing out this issue!

Kind regards,

Andrew

On 1 Nov 2023, at 07:20, Hakan Kjellerstrand @.***> wrote:

@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 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

andrewcropper avatar Nov 01 '23 08:11 andrewcropper