Computing the likelihood term for a logistic
output unit
The output of the logistic unit is the probability
that the network assigns to the answer 1. It
assigns the complementary probability to the
answer 0.
if d=1     if d=0