title: How to get probabilities from Resnet using pytorch?
body: <p>I am finetuning resnet on my dataset which has multiple labels. </p>
  
  <p>I would like to convert the 'scores' of the classification  layer to probabilities and use those probabilities to calculate the loss at the training. </p>
  
  <p>Could you give an example code for this?
  Can I use like this:</p>
  
  <pre><code>       P = net.forward(x)
         p = torch.nn.functional.softmax(P, dim=1)
         loss = torch.nn.functional.cross_entropy(P, y)
  </code></pre>
  
  <p>I am unclear whether this is the correct way or not as I am passing probabilities as the input to crossentropy loss.</p>