I'm using a custom loss function that optimizes for predicting the loss of the main…
- User
I'm using a custom loss function that optimizes for predicting the loss of the main prediction as well. Should the ".detach" be there?
class HuberLoss_conf(nn.Module): def __init__(self, conf_weight=1.0): super().__init__() self.Huber_no_reduce = nn.HuberLoss(reduction='none') self.conf_weight = conf_weight def forward(self, preds, conf, target): loss = self.Huber_no_reduce(preds, target) loss2 = self.conf_weight * self.Huber_no_reduce(conf, loss.detach()) combined_loss = loss + loss2 return torch.mean(combined_loss) Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.