Hi roxor!



 roxor:

I want to penalize some missclassification stronger than others.


One approach is to use cross-entropy with probabilistic or soft targets.
This post has further discussion and details:

  
    
    
    Label smoothing for only a subset of classes 
  
  
    Hi macazinc! 

Here’s what I think you’re asking: 
You have a multi-class (30 classes) classification problem.  You know 
that for most of your classes, your ground-truth target labels are 
correct, but your labels sometimes mix up two of your classes, say 4 
and 9,  Let’s say that a sample labelled 4 is actually a 9 25% of the 
time, and that a sample labelled 9 is actually a 4 10% of the time. 
You will (most likely) want to use cross-entropy loss, but pytorch only 
provides a version that tak…
  


Best.
K. Frank