Structure Learning

LoMRF employs structure learning using on-line algorithms, in order to update the structure and its weights at each learning step according to a sequence of training examples (micro-batches). Compare to batch learning methods, the main benefits of on-line structure learning is that it can scale to problems with large amount of data and that can revise/refine an MLN model according to new training examples.

The supported algorithms are OSL and OSLa -- for details see Huynh and Mooney (2011) and Michelioudakis et. al. (2016).

Types of structure learning in LoMRF

In order to perform structure learning in LoMRF the following definitions are required:

Important note: Structure learning in the current version of LoMRF does not support build-in dynamic functions and predicates (e.g., t++, a = b, etc.).

Structure learning using the lomrf slearn command-line tool

To demonstrate the usage of LoMRF from command-line interface for structure learning, assume that we have one knowledge base file, named as theory.mln, and a set of training files, named as training1.db, training2.db etc, containing both the evidence and the supervision.

In our example knowledge-base we have the following predicates:

Predicate Name Number of arguments Predicate identity Description
NonEvidence_A 2 NonEvidence_A/2 first non-evidence predicate
NonEvidence_B 2 NonEvidence_B/2 second non-evidence predicate
Template_A 2 Template_A/2 first template predicate
Template_B 2 Template_B/2 second template predicate
Ev_A 1 EV_A/1 first evidence predicate
Ev_B 1 EV_B/1 second evidence predicate

As it is presented in the above table, there are two non-evidence predicates, NonEvidence_A and NonEvidence_B, where each one takes two terms as arguments. Therefore their atomic signatures are NonEvidence_A/2 and NonEvidence_B/2. Similarly, there are two evidence predicates Ev_A and Ev_B that they take one term as argument. Therefore, the atomic signatures of Ev_A and Ev_B are Ev_A/1 and Ev_B/1, respectively. As stated above, for all of them LoMRF assumes Closed-world assumption. Finally, we can optionally define template predicates. In the above table there are two template predicates Template_A and Template_B where each one takes two terms as arguments. Therefore their atomic signatures are Template_A/2 and Template_B/2.

OSL learning

lomrf slearn -i theory.mln -t /path/to/training/batches/ -o learned.mln -ne NonEvidence_A/2,NonEvidence_B/2

OSLa learning

lomrf slearn -i theory.mln -t /path/to/training/batches/ -o learned.mln -ne NonEvidence_A/2,NonEvidence_B/2 -template Template_A/2,Template_B/2

The results of learning are stored in the learned.mln (see parameter -o)

Structure Learning Examples

For a detailed structure learning tutorial in LoMRF, see Sections Structure Learning Examples. Sources from the examples are located in the LoMRF-data project (follow the instructions in Download Example Data).

Command-line Interface Options

By executing the lomrf slearn -h (or lomrf slearn --help) command from the command-line interface, we get a print of multiple parameters. Below we explain all LoMRF structure learning command-line interface parameters:

Basic structure learning options

Advanced structure learning options