def cat_error(preds, targets, num_outputs):
# NOTE: preds matri gives log likelihood of result, not likelihood probability
# raise to exponential to get correct value
# Use Brier score for error estimate
preds = preds - logsumexp(preds, axis=1, keepdims=True)
pred_probs = np.exp(preds)
return np.mean(np.linalg.norm(pred_probs - targets, axis=1))
评论列表
文章目录