Same. I created a post over here since my negative KL divergence values might be caused by the output of torch.nn.functional.softmax producing vectors that don’t sum to 1.

  
    
    
    Torch.nn.functional's softmax does not sum to 1 
  
  
    I started receiving negative KL divergences between a target Dirichlet distribution and my model’s output Dirichlet distribution. Someone online suggested that this might be indicative that the parameters of the Dirichlet distribution don’t sum to 1. I thought this was ridiculous since the output of the model is passed through 
output = F.softmax(self.weights(x), dim=1) 
But after looking into it more closely, I found that  torch.all(torch.sum(output, dim=1) == 1.) returns False! Looking at the …