def __init__(self, dataloader_kNN, num_classes):
    super().__init__(dataloader_kNN, num_classes)
    resnet = lightly.models.ResNetGenerator('resnet-18')
    self.backbone = nn.Sequential(*list(resnet.children())[:(- 1)], nn.AdaptiveAvgPool2d(1))
    self.projection_head = heads.ProjectionHead([(512, 2048, nn.BatchNorm1d(2048), nn.ReLU(inplace=True)), (2048, 2048, None, None)])
    self.criterion = lightly.loss.BarlowTwinsLoss(gather_distributed=gather_distributed)
def __init__(self, dataloader_kNN, num_classes):
    super().__init__(dataloader_kNN, num_classes)
    resnet = lightly.models.ResNetGenerator('resnet-18')
    self.backbone = nn.Sequential(*list(resnet.children())[:(- 1)], nn.AdaptiveAvgPool2d(1))
    self.projection_head = heads.ProjectionHead([(512, 2048, nn.BatchNorm1d(2048), nn.ReLU(inplace=True)), (2048, 2048, None, None)])
    self.criterion = lightly.loss.BarlowTwinsLoss(gather_distributed=gather_distributed)