We interpret the final values of \(X^{(t_{max})}_p[e]\)  (after \(t_{max}\)  steps of forward chaining) as the conditional probability for the value of atom given the model parameters and we define the loss as the average cross-entropy loss between the ground truth provided by the positive and negative examples for the corresponding predicate \(p\) ) and \(X_{p}^{(t_{max})}\)  which is the algorithm output after \(t_{max}\)  forward chaining steps.
We train the model using ADAM ([1]}) optimizer to minimize the aggregate loss over all intensional predicates with the learning rate of 0.001 (in some cases we may increase the rate for faster convergence).
After the training is completed, a zero cross-entropy loss indicates that the model has been able to satisfy all the examples in the positive and negative sets. However, there might exist a few atoms with membership weights of '1' in the corresponding dNL network for a predicate which are not necessary for the satisfiability of the solution.
However, since there is no gradient at this point, those terms cannot be directly removed during the gradient descent algorithm unless we include some penalty terms.
In practice, we use a simpler approach.
In the final stage of algorithm we remove each atom if by switching its membership variable from ’1’ to ’0’, the loss function does not change.
<FIGURE>