SimCLR TRaining

Hello Everyone.
I have an understanding problem with Contrastive Learning and SimCLR framework.
The part of simclr I cannot understand is how you calculate the linear evaluation after you train your model with unlabeled dataset and finding the contrastive loss for every epoch you have set.

I read a lot of articles where they say about creating a Linear Classifier and train it to get the metrics(loss, accuracy etc.) you want. The training of Linear Classifier is the same as we train a classification model, for example:

for epoch in range (num_epochs):
    trainCorrect = 0
    #Initialize losses 
    batch_train_loss = 0.0
    #Network Training
    for batch in tqdm(train_loader):
      X, y = batch
      X, y =,
      output = LinearClassifier(X)
      train_loss = loss_fn(output, y)
      batch_train_loss += train_loss.item()
      trainCorrect += (yhat.argmax(1) == y).type(torch.float).sum().item()

Or you need something else for the metrics?
Thanks a lot in advance.