Giter Site home page Giter Site logo

kamel-usp / dpasp Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 4.0 778 KB

Differentiable probabilistic answer set programming

Home Page: https://kamel.ime.usp.br/dpasp.html

License: MIT License

Python 23.47% C 76.53%
answer-set-programming credal logic logic-programming probabilistic-logic-programming probabilistic-programming inference

dpasp's Issues

Repository of Neural Networks

Create a repository of pre-trained neural networks for common tasks such as object detection, object classification, entity extraction etc. Those networks should be easily accessible from a dpasp program by providing a URL identifier or similar. Maybe use something similar as huggingface or huggingface library itself.

MCMC Inference and Learning

Implement MCMC inference a la PASTA for probabilistic logic programs, then extend it to approximate learning of neural logic programs.

Packaging

Create packages for common distributions (debian/ubuntu, homebrew, what else?) and containerization (docker)

#Include directives

Allow for a #include "filename.py" or #include "filename.plp" directive that is equivalent to the Python snippet #python #end, but can be used to split a dpasp program into several files. The type of snipper can be deduced from the file extension. That should also help to make things more efficient, as e.g., we might pre-compile python files or pre-ground plp files.

Are Aggregates Fully Supported?

Hi. I'm writing a simple program but the following line:

fb(FB):- #count{ X : f(X), b(X)} = FB.

raises a syntax error (at FB after =).
However, by looking (very quickly) at the grammar in the source code, aggregates seems to be supported, but in limited form.
So, is there a way to represent the previously reported line within this tool?

Thanks.

ASEO for ADs, non-stratified and credal

Approximate inference through Answer Set Enumeration by Optimality (ASEO) is currently only implemented for probabilistic facts in stratified programs under the maxent semantics.

Adding support for annotated disjunctions (ADs), non-stratified programs and the credal semantics should not be too hard.

Dependency graph

Build dependency graph to help with grounding of probabilistic facts and accelerate inference

ASEO inference errors for non-grounded predicates

For a very simple (and stratified) program like:

mango_seller(1..3).

0.5::deal(X, Y) :- mango_buyer(X), mango_seller(Y).

was_deal :- deal(X, Y).

#query(was_deal).

we get non-converging inference errors with ASEO as opposed to the same program with the predicate was_deal grounded:

mango_seller(1..3).

0.5::deal(X, Y) :- mango_buyer(X), mango_seller(Y).

was_deal :- deal(1, 1).
was_deal :- deal(1, 2).
was_deal :- deal(1, 3).
was_deal :- deal(2, 1).
was_deal :- deal(2, 2).
was_deal :- deal(2, 3).
was_deal :- deal(3, 1).
was_deal :- deal(3, 2).
was_deal :- deal(3, 3).


#query(was_deal).
  • Weirdly enough this inference error phenomenon doesn't always occur when we use non-grounded predicates, e.g. in the case of the graph coloring program and the fail condition:
fail :- edge(X, Y), color(X, C), color(Y, C).

Note that this program is non-stratified.

Inference Errors by number of models

The Program with the one non-grounded predicate

nongrounded

The program with predicate grounded

grounded

And for the graph coloring problem

graphcol

Maximum a Posteriori Inference

Implement algorithms for maximum a posteriori inference, that is, finding the probable interpretation of a selected set of facts. Implement at least a brute-force algorithm and an algorithm that calls clingo or plingo for optimization/sampling. Can start with simple cases (acyclic/stratified programs) then move to programs with cycles and max-ent semantics.

Learning From Fully Observed Data

Implement efficient techniques for fully observed data (including at least observations of all probabilistic facts). Consider the case of probabilistic logic programs (solved in closed form) and neuro-probabilistic logic programs (still requiring gradient learning). Test with the Sudoku example (learn program that encodes Sudoku rules from images of handwritten sudoku solutions).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.