DeepLog predicate modules
REFERENCE
Built-in predicate modules
DeepLog ships a small set of predicate modules that every
Compiler wires in by default.
These are distinct from the DeepProbLog engine built-ins.
Overview
Predicate modules implement the leaves of a DeepLog formula graph. They
consume concrete symbol bindings and return tensors in the chosen structure
(e.g. boolean, probability, logprobability).
Built-ins
Predicate |
Arity |
Structure |
Meaning / usage |
|---|---|---|---|
|
2 |
|
Equality over a finite domain. |
|
2 |
|
Probability label |
|
2 |
|
Log-probability label |
|
2 |
|
Neural predicate backed by a torch module. |
Details
EqualityPredicate: registered under
=; compares symbols after mapping the provided domain to integer ids.ProbabilityPredicate: registered under
p; weighs a truth value, a variable’s or a writtentrueorfalse, by its label, a number or an input; use_probabilityor_logprobabilityto select semiring.NetworkPredicate: registered under a binary predicate of the user’s choosing, with its module and domain bound, as
atom_builders={("digit", 2, "probability"): partial(NetworkPredicate, module=net, domain=Domain.of(range(10)))}; delegates evaluation to a providedtorch.nn.Module. The predicate passes the first argument through the module, whose output rows stand for the domain’s values in order, anddigit(x, v)is the entry ofx’s row atv’s position. It computes every value of each first argument it is given, running the module once per distinct first argument.Your own predicate: declares the domain of each argument, its sort, with
domains. Over a named or a tensor domain, a value written there is read as a variable there holds it; over the values,Domain.of_values(), the predicate reads an argument as it is. A variable ranges over the domain of the arguments it is.
See also
DeepLog language for the formula language syntax.
DeepProbLog built-in predicates for the Prolog-style engine built-ins.