Hi, I have a very imbalanced data where the weight is in the range [0.0000000012,1], in order to use the weighted NLLloss, if I apply directly these extreme small value weight, I get the very small loss, so if I want to get the same indicator as the case without weight before. What is the strategy of assigning weights?
In other words, 1. what should my weight look like (for example weight all > 0 etc.)
2. If the weighed NLLloss is used, for the loss, if I need to multiple a factor to get the same representation(with out weight)?
An example:
import torch
import torch.nn as nn
log_prob = torch.tensor([[-0.0141, -4.2669]])
target = torch.tensor([0])
criterion = nn.NLLLoss()

criterion(log_prob, target)

out: tensor(0.0141)
log_prob = torch.tensor([[-0.0141, -4.2669]])
target = torch.tensor([0])
weight = torch.tensor([0.00009, 0.99991])
criterion = nn.NLLLoss(weight=weight,  reduction='sum')

criterion(log_prob, target)

out:tensor(1.2690e-06)
So in the second case, how to know that my network is well trained since the loss value is already very small.
Thank you