Loss function
Cross Entropy Loss
Gradient Calculation
// Let's consider that's it's single data point i.e N = 1
logit = XW+b // c dimensional output where c is # of classes
ypred = e^logit_c/(\sum_c e^logit_c) // softmax to normalize logits
Loss = \sum_c y_c log(ypred_c) // y_c is ground truth label. Last updated