If the $i$th formula has $n_i(x)$ true groundings in the data x,
then the derivative of the log-likelihood with respect to its weight is
$\frac{\partial{}}{\partial{\,w_i}}log P_w(X=x) = n_i(x) - \sum_{x‘}P_w(X=x‘)\,n_i(x‘)$
#true groundings of the $i$th formula - its expectation
If $x$ is a possible world and $x_l$ is the $l$th ground atoms‘s truth value,
then the derivative of the pseudo-log-likelihood of $x$ given weights $w$ is
原文:http://www.cnblogs.com/linxd/p/4991192.html