def __init__(
        self,
        temperature: float = 0.1,
        sinkhorn_iterations: int = 3,
        regularization_weight: float = 1.0,
        me_max_weight: Optional[float] = None,
        gather_distributed: bool = False,
    ):
        """Initializes the MSNLoss module with the specified parameters.

        Args:
            temperature:
                Similarities between anchors and targets are scaled by the inverse of the temperature. Must be in (0, inf).
            sinkhorn_iterations:
                Number of sinkhorn normalization iterations on the targets.
            regularization_weight:
                Weight factor lambda by which the regularization loss is scaled. Set to 0 to disable regularization.
            me_max_weight:
                Deprecated, use `regularization_weight` instead. Takes precedence over
                `regularization_weight` if not None. Weight factor lambda by which the mean
                entropy maximization regularization loss is scaled. Set to 0 to disable mean
                entropy maximization regularization.
            gather_distributed:
                If True, then target probabilities are gathered from all GPUs.

        Raises:
            ValueError: If temperature is not in (0, inf).
            ValueError: If sinkhorn_iterations is less than 0.
            ValueError: If gather_distributed is True but torch.distributed is not available.
        """
        super().__init__()
        if temperature <= 0:
            raise ValueError(f"temperature must be in (0, inf) but is {temperature}.")
        if sinkhorn_iterations < 0:
            raise ValueError(
                f"sinkhorn_iterations must be >= 0 but is {sinkhorn_iterations}."
            )
        if gather_distributed and not dist.is_available():
            raise ValueError(
                "gather_distributed is True but torch.distributed is not available. "
                "Please set gather_distributed=False or install a torch version with "
                "distributed support."
            )

        self.temperature = temperature
        self.sinkhorn_iterations = sinkhorn_iterations
        self.regularization_weight = regularization_weight
        # Set regularization_weight to me_max_weight for backwards compatibility
        if me_max_weight is not None:
            warnings.warn(
                DeprecationWarning(
                    "me_max_weight is deprecated in favor of regularization_weight and "
                    "will be removed in the future."
                )
            )
            self.regularization_weight = me_max_weight
        self.gather_distributed = gather_distributed
Initializes the MSNLoss module with the specified parameters.

        Args:
            temperature:
                Similarities between anchors and targets are scaled by the inverse of the temperature. Must be in (0, inf).
            sinkhorn_iterations:
                Number of sinkhorn normalization iterations on the targets.
            regularization_weight:
                Weight factor lambda by which the regularization loss is scaled. Set to 0 to disable regularization.
            me_max_weight:
                Deprecated, use `regularization_weight` instead. Takes precedence over
                `regularization_weight` if not None. Weight factor lambda by which the mean
                entropy maximization regularization loss is scaled. Set to 0 to disable mean
                entropy maximization regularization.
            gather_distributed:
                If True, then target probabilities are gathered from all GPUs.

        Raises:
            ValueError: If temperature is not in (0, inf).
            ValueError: If sinkhorn_iterations is less than 0.
            ValueError: If gather_distributed is True but torch.distributed is not available.
        
lightly/loss/msn_loss.py