标签:abi load like sts sum ike mic lis bsp
If I have bunch of events and a bunch of probabilities, how likely is it those events happen based on the probabilities?
If it is very likely then we have a small cross entropy;
If it is unlikely, then we have a large cross entropy.
import numpy as np # Write a function that takes as input two lists Y, P, # and returns the float corresponding to their cross-entropy. def cross_entropy(Y, P): Y = np.float_(Y) P = np.float_(P) return -np.sum(Y * np.log(P) + (1 - Y) * np.log(1 - P))
[Intro to Deep Learning with PyTorch -- L2 -- N20] Cross-Entropy
标签:abi load like sts sum ike mic lis bsp
原文地址:https://www.cnblogs.com/Answer1215/p/13117976.html