def training_step(self, batch, batch_idx):
    utils.update_momentum(self.backbone, self.backbone_momentum, m=0.99)
    utils.update_momentum(self.projection_head, self.projection_head_momentum, m=0.99)
    ((x0, x1), _, _) = batch
    p0 = self.forward(x0)
    z0 = self.forward_momentum(x0)
    p1 = self.forward(x1)
    z1 = self.forward_momentum(x1)
    loss = (0.5 * (self.criterion(p0, z1) + self.criterion(p1, z0)))
    self.log('train_loss_ssl', loss)
    return loss
def training_step(self, batch, batch_idx):
    utils.update_momentum(self.backbone, self.backbone_momentum, m=0.99)
    utils.update_momentum(self.projection_head, self.projection_head_momentum, m=0.99)
    ((x0, x1), _, _) = batch
    p0 = self.forward(x0)
    z0 = self.forward_momentum(x0)
    p1 = self.forward(x1)
    z1 = self.forward_momentum(x1)
    loss = (0.5 * (self.criterion(p0, z1) + self.criterion(p1, z0)))
    self.log('train_loss_ssl', loss)
    return loss