<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Deep Learning for Probabilistic Logic Programming</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Arnaud Nguembang Fadja</string-name>
          <email>arnaud.nguembafadja@unife.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Supervisors: Fabrizio Riguzzi</string-name>
          <email>fabrizio.riguzzi@unife.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Evelina Lamma</string-name>
          <email>evelina.lamma@unife.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dipartimento di Ingegneria</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Dipartimento di Matematica e Informatica</institution>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Ferrara Via Saragat</institution>
          <addr-line>1, I-44122, Ferrara</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Due to its expressiveness and intuitiveness, Probabilistic logic programming (PLP) is a useful tool for reasoning in relational domains with uncertainty. However, both inference and learning are expensive tasks. In this paper we present various approaches for speeding up learning. We rst consider a restriction of PLP called Liftable PLP (LPLP) in which clauses in the program share the same predicate (the target). Then we extend this restriction in Hierarchical PLP (HPLP) where predicates and clauses are hierarchically organized and can be translated into Deep Neural Networks or Arithmetic Circuits. For LPLP, we propose two parameter learning algorithms, Expectation Maximization (EM) and Limited memory BFGS (LBFGS), and a discriminative structure learning. We also propose and implement an algorithm, called Parameter learning for HIerarchical probabilistic Logic program (PHIL) 3 that learns the parameter of HPLP using EM and gradient method.</p>
      </abstract>
      <kwd-group>
        <kwd>Probabilistic Logic Programming</kwd>
        <kwd>Hierarchical PLP</kwd>
        <kwd>Liftable PLP</kwd>
        <kwd>Deep Neural Networks</kwd>
        <kwd>Arithmetic Circuits</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Probabilistic logic programming (PLP) under the distribution semantics [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] has
been very useful in machine learning. However, inference is expensive so machine
learning algorithms may turn out to be slow. In Logic Programs with Annotated
Disjunctions (LPADs) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], programs allow alternatives in the head of clauses.
Clauses, Ci, are of the form hi1 : i1; : : : ; hini : ini : bi1; : : : ; bimi where
hi1; : : : ; hini are logical atoms, bi1; : : : ; bimi are logical literals and
i1; : : : ; ini are real numbers in the interval [0; 1] that sum up to 1. In order to
speed up the inference and the learning in PLP, we consider two restrictions of
LPADs: in the rst, called Liftable PLP (LPLP), clauses in the program share
the same predicate (the target) and inference is performed by reasoning on a
whole populations of individuals rather than considering each individual
separately [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. In the second, called Hierarchical PLP (HPLP), see [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] clauses and
3 The code and the datasets are available at https://github.com/ArnaudFadja/phil.
predicates are hierarchically organized and can be translated into an arithmetic
circuit (AC) or a deep neural network. Inference in this case is done by evaluating
the Network or the Arithmetic circuit. Parameter learning in both approaches
can be done by applying gradient method or Expectation Maximization (EM)
algorithms.
      </p>
      <p>The paper is organized as follows: Sections 2 and 3 present Liftable PLP and
Hierarchical PLP. Section 4 presents parameter learning of LPLP and HPLP
and structure learning for LPLP. Finally Section 5 concludes and presents future
work.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Liftable PLP</title>
      <p>
        In order to improve inference in LPADs, we restrict the language of LPADs by
allowing only clauses of the form Ci = hi : i : bi1; : : : ; biui in the program
where all the clauses share the same predicate for the single atom in the head, let
us call this predicate r=a with a the arity. The literals in the body have predicates
other than r=a and are de ned by facts and rules that are certain, i.e., they have
a single atom in the head with probability 1. The predicate r=a is called target
and the others input predicates. A program containing n probabilistic clauses of
the form above is called liftable PLP. The probability of a query q being true
can be compute at liftable level with P (q) = 1 Qin=1(1 i)mi as described
[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] where n is the number of clauses and mi the number of ground instances of
each clause. Here is an example of LPLP where the objective is to predict the
target predicate \advised by"
advisedby(A; B) : 0:3 :
      </p>
      <p>student(A); prof essor(B); project(C; A); project(C; B):
advisedby(A; B) : 0:6 :</p>
      <p>student(A); prof essor(B); ta(C; A); taughtby(C; B):
3</p>
    </sec>
    <sec id="sec-3">
      <title>Hierarchical PLP</title>
      <p>HPLP extends LPLP by adding more layers of rules. In fact, a program in
HPLP contains a set of rules that de ne the target predicate r using a number of
input and hidden predicates. Hidden predicates are disjoint from input and target
predicates. Each rule in the program has a single head atom annotated with a
probability. The program is hierarchically de ned so that it can be divided into
layers. Each layer contains a set of hidden predicates that are de ned in terms
of predicates of the layer immediately below or in terms of input predicates.</p>
      <p>A generic clauses C is of the form
C = p(X) :
:
(X; Y ); b1(X; Y ); : : : ; bm(X; Y )
(1)
where (X; Y ) is a conjunction of literals for the input predicates using variables
X; Y . The literals bi(X; Y ) for i = 1; : : : ; m are built on a hidden predicate.
Y is a possibly empty vector of variables. They are existentially quanti ed with
scope the body. Only literals for input predicates can introduce new variables
into the clause and all literals for hidden predicates must use the whole set of
variables X; Y . Moreover, we require that the predicate of each bi(X; Y ) does
not appear elsewhere in the body of C or in the body of any other clause. We
call hierarchical PLP the language that admits only programs of this form. An
example of HPLP is shown in the following program:</p>
      <p>C1 = advisedby(A; B) : 0:3 :
student(A); prof essor(B); project(C; A); project(C; B);
r11(A; B; C):
C2 = advisedby(A; B) : 0:6 :</p>
      <p>student(A); prof essor(B); ta(C; A); taughtby(C; B):
C111 = r11(A; B; C) : 0:2 :</p>
      <p>publication(D; A; C); publication(D; B; C):
where r11=3 is a hidden predicate.</p>
      <p>The grounding of an HPLP can be generated and translated into Arithmetic
Circuits (ACs) sharing parameters. In the AC we de ne 2 operators: the operator
that computes the joint probability of its arguments ( literals in the body of
a clause) and the operator that computes the probability of the disjunction
of n independent random variables associated with individual clauses.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Parameter and Structure Learning</title>
      <p>The parameter learning algorithm can be expressed as follows: Given a LPLP or
an HPLP T with parameters , an interpretation I de ning input predicates and
a set of positive and negative examples E = fe1; : : : ; eM ; not eM+1; : : : ; not eN g
where each ei is a ground atom for the target predicate r, nd the values of
that maximize the (log) likelihood (LL):</p>
      <p>M
arg max X log P (ei) +
i=1</p>
      <p>N</p>
      <p>X log(1
i=M+1</p>
      <p>P (ei))
(2)
or that minimize the sum of cross entropy errors, erri = yi log(pi) (1
yi) log(1 pi), for all the examples (the two formulations are equivalent). We
propose an EM and a gradient method algorithm for each language.</p>
      <p>EM nds the maximun likelihood estimates of parameters in models with
hidden variables by alternating between an Expectation and a Maximization
step. Gradient method instead computes the partial derivatives of the (log)
likelihood w.r.t each parameter in order to move the parameters in the direction that
minimize the (log) likelihood. Let Xij be the random variable associated with a
grounding Ci j of clause Ci. To perform EM we need to compute the
distribution of the hidden variables given the observed ones, that are P (Xij = 1je) and
P (Xij = 1j:e). For a single example e, the Expectation step computes E[ci0je]
and E[ci1je] for all rules Ci where cix is the number of times a variable Xij takes
value x for x 2 f0; 1g and for all j 2 g(i) i.e</p>
      <p>E[cixje] = X P (Xij = xje)</p>
      <p>j2g(i)
where g(i) = fjj j is a substitution grounding Cig. These values are aggregated
over all examples obtaining E[ci0] = Pe2E Pj2g(i) P (Xij = 0je) and E[ci1] =
Pe2E Pj2g(i) P (Xij = 1je).</p>
      <p>Then the Maximization computes
i =</p>
      <p>E[ci1]</p>
      <p>
        E[ci0] + E[ci1]
For LPLP, see [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], we have:
      </p>
      <p>P (Xij = 1je) = 1 Qin=1(1 i)mi</p>
      <p>i
P (Xij = 1j:e)
=
0
where mi is the number of instanciation of Ci whose head is e and i the
parameter associate with Ci.</p>
      <p>
        In HPLP, P (Xij = 1je) is computed by performing two steps over the factor
graph associated with the AC as described in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
      </p>
      <p>
        We also propose a gradient method algorithm for LPLP and HPLP.
In LPLP, we present a gradient-based method using LBFGS ([
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]), see [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>
        For HPLP, the algorithm, called DPHIL [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], starts by building a set of ground
ACs sharing parameters . At each iteration, three actions are performed on
each AC: the Forward pass computes the output v(n) of each node n in the
AC, the Backward pass computes the derivative of the error d(n) 4, that is the
gradient, with respect to each parameter
8&gt;d(pan) vv(p(ann) )
&gt;&gt; 1 v(pan)
d(n) = &lt;&gt;d(pan) 1 v(n)
&gt;Ppan d(pan):v(pan):(1
&gt;
&gt;
&gt;: d(pan)
if n is a L node,
if n is a
      </p>
      <p>node
i) if n= (Wi)
pan = not(n)
(3)
(4)
where pan is the parent of node n and i = (Wi) = 1+e1 Wi . Parameters are
updated using Adam the optimizer. These actions are repeatedly performed until
a maximum number of steps is reached or until certain conditions are satis ed.</p>
      <p>
        For LPLP we present a discriminative structure learning called LIFTCOVER
[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] 4 which, from a set of positive and negative examples, a background knowledge
and language bias (de ning which predicates can appear in the head/body of a
clause) nds a liftable PLP that maximize the LL of the examples. We solve this
problem by rst identifying good clauses guided by the LL. Clauses are found by
4 The code and the datasets are available at https://bitbucket.org/
machinelearningunife/liftcover.
a top-down beam search. The re nement operator adds a literal to the body of
the current clause, the literal is taken from a bottom clause built as in Progol [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
The set of clauses found in this phase is then considered as a single theory and
parameter learning is performed on it. Then the clauses with a parameter below a
user de ne threshold are discarded and the theory is returned. We experimented
and compare these algorithms with state-of-the-art learning algorithms and we
obtained similar and often better accuracy in a shorter time.
5
      </p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion and Future Work</title>
      <p>In this paper we presented two restrictions of the language of Logic Program
with Annotated Disjunction called Liftable and Hierarchical Probabilistic Logic
Programming (LPLP and HPLP) that allow fast inference. We also presented
an Expectation Maximization and a gradient method algorithm for learning the
parameters of both languages. Finally we presented, LIFTCOVER, an algorithm
for learning the structure of LPLP. In our future work, we plan to design an
implement an algorithm for learning both the parameters and the structure of
HPLP. We also plan to learn programs with continuous random variables for
HPLP in order to deal with continuous data such as images.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Fadja</surname>
            ,
            <given-names>A.N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lamma</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          :
          <article-title>Learning the parameters of deep probabilistic logic programs</article-title>
          . In: Bellodi,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Schrijvers</surname>
          </string-name>
          , T. (eds.)
          <article-title>Probabilistic Logic Programming (PLP 2018)</article-title>
          .
          <source>CEUR Workshop Proceedings</source>
          , vol.
          <volume>2219</volume>
          , pp.
          <volume>9</volume>
          {
          <fpage>14</fpage>
          .
          <string-name>
            <surname>Sun SITE Central Europe</surname>
          </string-name>
          , Aachen, Germany (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Muggleton</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <source>Inverse entailment and Progol. New Generat. Comput</source>
          .
          <volume>13</volume>
          ,
          <issue>245</issue>
          {
          <fpage>286</fpage>
          (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Nguembang</given-names>
            <surname>Fadja</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Lamma</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Riguzzi</surname>
          </string-name>
          ,
          <string-name>
            <surname>F.</surname>
          </string-name>
          :
          <article-title>Deep probabilistic logic programming</article-title>
          .
          <source>CEUR-WS</source>
          , vol.
          <year>1916</year>
          , pp.
          <volume>3</volume>
          {
          <fpage>14</fpage>
          .
          <string-name>
            <surname>Sun SITE Central Europe</surname>
          </string-name>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Nguembang</given-names>
            <surname>Fadja</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Riguzzi</surname>
          </string-name>
          ,
          <string-name>
            <surname>F.</surname>
          </string-name>
          :
          <article-title>Lifted discriminative learning of probabilistic logic programs</article-title>
          .
          <source>Machine Learning (Aug</source>
          <year>2018</year>
          ), https://doi.org/10.1007/ s10994-018-5750-0
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Nguembang</given-names>
            <surname>Fadja</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Riguzzi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            ,
            <surname>Lamma</surname>
          </string-name>
          , E.:
          <article-title>Expectation maximization in deep probabilistic logic programming</article-title>
          . In: Ghidini,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Magnini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Passerini</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . (eds.)
          <article-title>Proceedings of the 17th Conference of the Italian Association for Arti cial Intelligence (AI*IA2018), Trento</article-title>
          , Italy,
          <fpage>20</fpage>
          -
          <lpage>23</lpage>
          November,
          <year>2018</year>
          . Lecture Notes in Computer Science, Springer, Heidelberg, Germany (
          <year>2018</year>
          ), http://mcs.unife.it/~friguzzi/ Papers/NguRigLam-AIXIA18.pdf
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Nocedal</surname>
          </string-name>
          , J.:
          <article-title>Updating quasi-newton matrices with limited storage</article-title>
          .
          <source>Math. Comput</source>
          .
          <volume>35</volume>
          (
          <issue>151</issue>
          ),
          <volume>773</volume>
          {
          <fpage>782</fpage>
          (
          <year>1980</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Poole</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>First-order probabilistic inference</article-title>
          . In: Gottlob,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Walsh</surname>
          </string-name>
          , T. (eds.)
          <source>IJCAI-2003</source>
          . pp.
          <volume>985</volume>
          {
          <fpage>991</fpage>
          . Morgan Kaufmann Publishers (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Sato</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>A statistical learning method for logic programs with distribution semantics</article-title>
          . In: Sterling,
          <string-name>
            <surname>L</surname>
          </string-name>
          . (ed.)
          <source>ICLP-1995</source>
          . pp.
          <volume>715</volume>
          {
          <fpage>729</fpage>
          . MIT Press (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Vennekens</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Verbaeten</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bruynooghe</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Logic Programs With Annotated Disjunctions</article-title>
          .
          <source>In: ICLP-2004. LNCS</source>
          , vol.
          <volume>3132</volume>
          , pp.
          <volume>431</volume>
          {
          <fpage>445</fpage>
          . Springer (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>