Closed xf1994 closed 6 years ago
In your implementation of Angleloss, the cross_entropy is calculated as:
logpt = F.log_softmax(output) logpt = logpt.gather(1,target) logpt = logpt.view(-1) pt = Variable(logpt.data.exp()) loss = -1 * (1-pt)**self.gamma * logpt loss = loss.mean()
It seems you only calculate the entropy of the target samples. Others are not calculated.
In your implementation of Angleloss, the cross_entropy is calculated as:
It seems you only calculate the entropy of the target samples. Others are not calculated.