def logprob(predictions, labels):
 predictions[(predictions < 1e-10)] = 1e-10
 return (np.sum(np.multiply(labels, (- np.log(predictions)))) / labels.shape[0])

def logprob ( predictions , labels ) : predictions [ ( predictions < 1e-10 ) ] = 1e-10 return ( np . sum ( np . multiply ( labels , ( - np . log ( predictions ) ) ) ) / labels . shape [ 0 ] )
log-probability of the true labels in a predicted batch .