<commit_before>import torch.nn as nn
from mmdet.core import weighted_iou_loss

from ..registry import LOSSES


@LOSSES.register_module
class IoULoss(nn.Module):

    def __init__(self, style='naive', beta=0.2, eps=1e-3, loss_weight=1.0):
        super(IoULoss, self).__init__()
        self.style = style
        self.beta = beta
        self.eps = eps
        self.loss_weight = loss_weight

    def forward(self, pred, target, weight, *args, **kwargs):
        loss = self.loss_weight * weighted_iou_loss(
            pred,
            target,
            weight,
            beta=self.beta,<commit_msg>fix bug in iou loss style (#713)<commit_after>import torch.nn as nn
from mmdet.core import weighted_iou_loss

from ..registry import LOSSES


@LOSSES.register_module
class IoULoss(nn.Module):

    def __init__(self, style='naive', beta=0.2, eps=1e-3, loss_weight=1.0):
        super(IoULoss, self).__init__()
        self.style = style
        self.beta = beta
        self.eps = eps
        self.loss_weight = loss_weight

    def forward(self, pred, target, weight, *args, **kwargs):
        loss = self.loss_weight * weighted_iou_loss(
            pred,
            target,
            weight,
            style=self.style,
            beta=self.beta,
{'fraction_non_alphanumeric': 0.10643367752184273, 'fraction_numerical': 0.011914217633042097, 'mean_word_length': 2.3962264150943398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7534380', 'n_tokens_mistral': 425, 'n_tokens_neox': 402, 'n_words': 96}