def __init__(
        self,
        alpha: float = 1,
        t_consistency: float = 0.05,
        memory_bank_size: Union[int, Sequence[int]] = 0,
    ):
        """Initializes the CO2Regularizer with the specified parameters.

        Args:
            alpha:
                Weight of the regularization term.
            t_consistency:
                Temperature used during softmax calculations.
            memory_bank_size:
                Size of the memory bank.
        """
        super().__init__()
        self.memory_bank = MemoryBankModule(size=memory_bank_size)
        # Try-catch the KLDivLoss construction for backwards compatability
        self.log_target = True
        try:
            self.kl_div = torch.nn.KLDivLoss(reduction="batchmean", log_target=True)
        except TypeError:
            self.log_target = False
            self.kl_div = torch.nn.KLDivLoss(reduction="batchmean")

        self.t_consistency = t_consistency
        self.alpha = alpha
Initializes the CO2Regularizer with the specified parameters.

        Args:
            alpha:
                Weight of the regularization term.
            t_consistency:
                Temperature used during softmax calculations.
            memory_bank_size:
                Size of the memory bank.
        
lightly/loss/regularizer/co2.py