Mukesh1729:

# def softXEnt(input, target):
#     logprobs = torch.nn.functional.log_softmax (input, dim = 1)
#     return  -(target * logprobs).mean()



Someone from the forums suggested me to remove the Softmax and mse loss and try this instead:
  
    
    
    Compute mse_loss() with softmax() vision
  
  
    Hey Frank, 
I tried to use the softmax in the last layer with the  MSE loss. The model predictions and ground truth look a bit similar to what the prediction was from the last post using the loss function you suggested to me. 
Model predictions 
 [image] 
They look quite close compared to the target but then I end up with the problem of the loss not going down. The loss you suggested is not helping the model learn the heatmaps somehow but the loss goes down in value. In the ref paper, they menti…
  


def softXEnt(input, target):
     logprobs = torch.nn.functional.log_softmax (input, dim = 1)
     return  -(target * logprobs).mean()

In this case, the loss decreases but the model learns poorly as i can see from the predictions