ece_loss/loss.py
def forward(
        self,
        input: Tensor,  # pylint: disable=W0622
        target: Optional[Tensor] = None,
        epoch: Optional[int] = None,
        unannotated_mapping: Optional[Callable] = None,
    ) -> Tensor:
        """
        Overwrites the original forward function of the cross entropy loss (in all its variants: CrossEntropyLoss,
        BCELoss, BCEWithLogitsLoss) in order to be used in the familiar way.

        Assumes default zero tensors for the target and assigns the uses the most updated epoch value (either given
        as input or using the pre-set value)

        :param unannotated_mapping: mapping function to retrieve location of unannotated areas/samples. E.g.: for a
            binary mask this can be a lambda x: x == 0.
        :param epoch: the current epoch number of training used for annealing parameters of the ECE loss
        :param input: representing the unlabelled samples, a list of bounding box confidences of shape BxN, or a list
            of pixels from re-shaped images of shape Bx(HxW), or classification predictions of shape B or multiclass
            input of shape BxC..., where C is the number of classes.
        :param target: Optional parameter for the target ground truth values in the same shape as the expected input
            of the (binary) cross entropy functions. If not given, the assumed background label is zero.
        :return: the exclusive cross entropy loss value
        """
        if target is None:
            target = input.new_zeros(len(input), dtype=self.target_dtype)

        if epoch is None:
            epoch = self.epoch

        if unannotated_mapping is None:
            unannotated_mapping = self.unannotated_mapping

        return self.forward_(input, target, epoch, unannotated_mapping)

        Overwrites the original forward function of the cross entropy loss (in all its variants: CrossEntropyLoss,
        BCELoss, BCEWithLogitsLoss) in order to be used in the familiar way.

        Assumes default zero tensors for the target and assigns the uses the most updated epoch value (either given
        as input or using the pre-set value)

        :param unannotated_mapping: mapping function to retrieve location of unannotated areas/samples. E.g.: for a
            binary mask this can be a lambda x: x == 0.
        :param epoch: the current epoch number of training used for annealing parameters of the ECE loss
        :param input: representing the unlabelled samples, a list of bounding box confidences of shape BxN, or a list
            of pixels from re-shaped images of shape Bx(HxW), or classification predictions of shape B or multiclass
            input of shape BxC..., where C is the number of classes.
        :param target: Optional parameter for the target ground truth values in the same shape as the expected input
            of the (binary) cross entropy functions. If not given, the assumed background label is zero.
        :return: the exclusive cross entropy loss value
        
Overwrites the original forward function of the cross entropy loss (in all its variants: CrossEntropyLoss,
BCELoss, BCEWithLogitsLoss) in order to be used in the familiar way.

Assumes default zero tensors for the target and assigns the uses the most updated epoch value (either given
as input or using the pre-set value)
Overwrites the original forward function of the cross entropy loss ( in all its variants : CrossEntropyLoss BCELoss BCEWithLogitsLoss ) in order to be used in the familiar way . Assumes default zero tensors for the target and assigns the uses the most updated epoch value ( either given as input or using the pre - set value )
def forward(
        self,
        input: Tensor,  
        target: Optional[Tensor] = None,
        epoch: Optional[int] = None,
        unannotated_mapping: Optional[Callable] = None,
    ) -> Tensor:
        if target is None:
            target = input.new_zeros(len(input), dtype=self.target_dtype)
        if epoch is None:
            epoch = self.epoch
        if unannotated_mapping is None:
            unannotated_mapping = self.unannotated_mapping
        return self.forward_(input, target, epoch, unannotated_mapping)
def forward ( self , input : Tensor , target : Optional [ Tensor ] = None , epoch : Optional [ int ] = None , unannotated_mapping : Optional [ Callable ] = None , ) -> Tensor : if target is None : target = input . new_zeros ( len ( input ) , dtype = self . target_dtype ) if epoch is None : epoch = self . epoch if unannotated_mapping is None : unannotated_mapping = self . unannotated_mapping return self . forward_ ( input , target , epoch , unannotated_mapping )
Overwrites the original forward function of the cross entropy loss (in all its variants: CrossEntropyLoss,
BCELoss, BCEWithLogitsLoss) in order to be used in the familiar way.
Overwrites the original forward function of the cross entropy loss ( in all its variants : CrossEntropyLoss BCELoss BCEWithLogitsLoss ) in order to be used in the familiar way .
# pylint: disable=W0622 """
        Overwrites the original forward function of the cross entropy loss (in all its variants: CrossEntropyLoss,
        BCELoss, BCEWithLogitsLoss) in order to be used in the familiar way.

        Assumes default zero tensors for the target and assigns the uses the most updated epoch value (either given
        as input or using the pre-set value)

        :param unannotated_mapping: mapping function to retrieve location of unannotated areas/samples. E.g.: for a
            binary mask this can be a lambda x: x == 0.
        :param epoch: the current epoch number of training used for annealing parameters of the ECE loss
        :param input: representing the unlabelled samples, a list of bounding box confidences of shape BxN, or a list
            of pixels from re-shaped images of shape Bx(HxW), or classification predictions of shape B or multiclass
            input of shape BxC..., where C is the number of classes.
        :param target: Optional parameter for the target ground truth values in the same shape as the expected input
            of the (binary) cross entropy functions. If not given, the assumed background label is zero.
        :return: the exclusive cross entropy loss value
        """
the exclusive cross entropy loss value
the exclusive cross entropy loss value
self
input
Tensor
representing the unlabelled samples, a list of bounding box confidences of shape BxN, or a list
of pixels from re-shaped images of shape Bx(HxW), or classification predictions of shape B or multiclass
input of shape BxC..., where C is the number of classes.
representing the unlabelled samples a list of bounding box confidences of shape BxN or a list of pixels from re - shaped images of shape Bx ( HxW ) or classification predictions of shape B or multiclass input of shape BxC ... where C is the number of classes .
target
Optional[Tensor]
Optional parameter for the target ground truth values in the same shape as the expected input
of the (binary) cross entropy functions. If not given, the assumed background label is zero.
Optional parameter for the target ground truth values in the same shape as the expected input of the ( binary ) cross entropy functions . If not given the assumed background label is zero .
epoch
Optional[int]
the current epoch number of training used for annealing parameters of the ECE loss
the current epoch number of training used for annealing parameters of the ECE loss
unannotated_mapping
Optional[Callable]
mapping function to retrieve location of unannotated areas/samples. E.g.: for a
binary mask this can be a lambda x: x == 0.
mapping function to retrieve location of unannotated areas / samples . E . g . : for a binary mask this can be a lambda x : x == 0 .