pepl.pl -- An implementation of the FAM algorithm.

Pepl is an implemention of the failure adjusted (FAM) algorithm which does parameter estimation (PE) of the probability labels of stochastic logic programs (SLPs).

See documentation fam/1 for details on how to run parameter estimation on SLPs.

Example stochastic programs are in directory slp and example run scripts are in examples.

Licence

This software is distributed under the MIT licence.

Installation and testing ...

Pepl runs on current versions of SWI (7) and Yap (6.3).

... on SWI

pack_install(pepl).
[library(pepl)].
[pack('pepl/examples/main')].
main.

... on Yap

Download latest sources from http://stoics.org.uk/~nicos/sware/pepl <br> or https://github.com/nicos-angelopoulos/pepl

gunzip pepl-*tgz
tar xf pepl-*tar
cd pepl-*
cd examples
yap
[main].
main.

Package information

author
- Nicos Angelopoulos
version
- 2.1, 2017/2/25
- 2.0.6, 2014/01/28
See also
- the user guide at pack('pepl/doc/pepl-user_guide.pdf').
- James Cussens. Parameter estimation in stochastic logic programs. Machine Learning, 44(3):245-271, 2001. ftp://ftp.cs.york.ac.uk/pub/aig/Papers/james.cussens/jcslpmlj.pdf
- Nicos Angelopoulos, Notes on the implementation of FAM, 3rd Probabilistic Logic Programming workshop (a ILP 2016 workshop), 03/09/2016, http://ceur-ws.org/Vol-1661/paper-05.pdf
- pepl website http://stoics.org.uk/~nicos/sware/pepl
license
- This software is distributed under the MIT licence
fam(Opts)
Run the failure adjusted maximisation (FAM) parameter estimation algorithm.

For SLP source file jc_ml_S1.slp

0.5:: s(X,p) :- p(X), p(X).
0.5:: s(X,q) :- q(X).
0.5:: p(a).
0.5:: p(b).
0.5:: q(a).
0.5:: q(b).

and data file jc_ml_S1_data.pl

frequencies([s(a,p)-4,s(a,q)-3,s(b,p)-2,s(b,q)-3]).

the call

   fam( [goal(s(_A,_B)),slp(jc_ml_S1),datafile('jc_ml_S1_data.pl'),final_pps(PPs)] ).

succeeds with

   PPs = [0.6602,0.3398,0.5858,0.4142,0.5,0.5]

Options:

pepl_citation(-Atom, -Bibterm)
This predicate succeeds once for each publication related to this library. Atom is the atom representation suitable for printing while Bibterm is a bibtex(Type,Key,Pairs) term of the same publication. Produces all related publications on backtracking.
pepl_version(-Version, Date)
Pepl's current Version (Maj:Min:Fix) and publication date (date(Year,Month,Day)).

pepl_version( 2:0:6, date(2014,1,28) ).

ssave(+File)
Save the stochastic program currently in memory to a file.
sls
Listiing of the stochastic program currently in memory.
sload_pe(Files)
sload_pe(Files, Options)
Load an SLP to memory. If the source file has an slp extension the extension may be omitted. Pepl looks in the following directories and order for the source file(s). ., and ./slp/ while on SWI it also looks in, pack(’pepl/slp/’).
scall(Goal)
Sample Goal.
?- sload_pe( [pack(pepl/slp/coin] ).
scall(Goal, Eps, Meth, Path, Succ, Prb)
This predicate is for people interested in the iternals of pepl. Use at your own peril.

The predicate arguments are as follows.

See predicate main_gen/1, in examples/main_scfg.pl for example usage.

switch_dbg(Switch)
Switch debugging of fam/1 to either on or off.
dbg_pepl(+Goal)
Call Goal iff in (pepl) debugging.