def entropy(self, logits):
        """ Categorical distribution entropy calculation - sum probs * log(probs) """
        probs = torch.exp(logits)
        entropy = - torch.sum(probs * logits, dim=-1)
        return entropy
def entropy ( self , logits ) : probs = torch . exp ( logits ) entropy = - torch . sum ( probs * logits , dim = - 1 ) return entropy
Categorical distribution entropy calculation - sum probs * log(probs)