kaggle_imet/data.py
def binary_encoding_to_labels(
        self,
        encoding: Tensor,
        thr: float = 0.5,
        with_sigm: bool = True,
        label_required: bool = True,
    ) -> Union[str, List[str]]:
        """Convert Model outputs to string labels

        Args:
            encoding: one-hot encoding
            thr: threshold for label binarization
            with_sigm: apply sigmoid to convert to probabilities
            label_required: if it is required to return any label and no label is above `thr`, use argmax
        """
        if with_sigm:
            encoding = torch.sigmoid(encoding)
        return self.binary_mapping(encoding, self.lut_label, thr=thr, label_required=label_required)
Convert Model outputs to string labels

        Args:
            encoding: one-hot encoding
            thr: threshold for label binarization
            with_sigm: apply sigmoid to convert to probabilities
            label_required: if it is required to return any label and no label is above `thr`, use argmax
        
Convert Model outputs to string labels
Convert Model outputs to string labels
def binary_encoding_to_labels(
        self,
        encoding: Tensor,
        thr: float = 0.5,
        with_sigm: bool = True,
        label_required: bool = True,
    ) -> Union[str, List[str]]:
        if with_sigm:
            encoding = torch.sigmoid(encoding)
        return self.binary_mapping(encoding, self.lut_label, thr=thr, label_required=label_required)
def binary_encoding_to_labels ( self , encoding : Tensor , thr : float = 0.5 , with_sigm : bool = True , label_required : bool = True , ) -> Union [ str , List [ str ] ] : if with_sigm : encoding = torch . sigmoid ( encoding ) return self . binary_mapping ( encoding , self . lut_label , thr = thr , label_required = label_required )
Convert Model outputs to string labels
Convert Model outputs to string labels
"""Convert Model outputs to string labels

        Args:
            encoding: one-hot encoding
            thr: threshold for label binarization
            with_sigm: apply sigmoid to convert to probabilities
            label_required: if it is required to return any label and no label is above `thr`, use argmax
        """
self
encoding
Tensor
None
thr
float
threshold for label binarization
threshold for label binarization
with_sigm
bool
apply sigmoid to convert to probabilities
apply sigmoid to convert to probabilities
label_required
bool
if it is required to return any label and no label is above `thr`, use argmax
if it is required to return any label and no label is above ` thr ` use argmax