code: def __init__(
      self,
      net,
      image_size,
      hidden_layer=-2,
      projection_hidden_size=256,
      num_classes_K=65336,
      projection_layers=4,
      student_temp=0.9,
      teacher_temp=0.04,
      local_upper_crop_scale=0.4,
      global_lower_crop_scale=0.5,
      moving_average_decay=0.9,
      center_moving_average_decay=0.9,
      augment_fn=None,
      augment_fn2=None,
  ):
      super().__init__()
      self.net = net
  
      # default BYOL augmentation
  
      DEFAULT_AUG = torch.nn.Sequential(
          RandomApply(T.ColorJitter(0.8, 0.8, 0.8, 0.2), p=0.3),
          T.RandomGrayscale(p=0.2),
          T.RandomHorizontalFlip(),
          RandomApply(T.GaussianBlur((3, 3), (1.0, 2.0)), p=0.2),
          T.Normalize(
              mean=torch.tensor([0.485, 0.456, 0.406]),
              std=torch.tensor([0.229, 0.224, 0.225]),
          ),
      )
  
      self.augment1 = default(augment_fn, DEFAULT_AUG)
      self.augment2 = default(augment_fn2, DEFAULT_AUG)
  
      # local and global crops
  
      self.local_crop = T.RandomResizedCrop(
          (image_size, image_size), scale=(0.05, local_upper_crop_scale)
      )
      self.global_crop = T.RandomResizedCrop(
          (image_size, image_size), scale=(global_lower_crop_scale, 1.0)
      )
  
      self.student_encoder = NetWrapper(
          net,
          num_classes_K,
          projection_hidden_size,
          projection_layers,
          layer=hidden_layer,
      )
  
      self.teacher_encoder = None
      self.teacher_ema_updater = EMA(moving_average_decay)
  
      self.register_buffer(
          "teacher_view_centers", torch.zeros(1, num_classes_K)
      )
      self.register_buffer(
          "last_teacher_view_centers", torch.zeros(1, num_classes_K)
      )
  
      self.register_buffer(
          "teacher_region_centers", torch.zeros(1, num_classes_K)
      )
      self.register_buffer(
          "last_teacher_region_centers", torch.zeros(1, num_classes_K)
      )
  
      self.teacher_centering_ema_updater = EMA(
          center_moving_average_decay
      )
  
      self.student_temp = student_temp
      self.teacher_temp = teacher_temp
  
      # get device of network and make wrapper same device
      device = get_module_device(net)
      self.to(device)
  
      # send a mock image tensor to instantiate singleton parameters
      self.forward(
          torch.randn(2, 3, image_size, image_size, device=device)
      )
  
imports: import copy
  import random
  from functools import wraps, partial
  import torch
  from torch import nn, einsum
  import torch.nn.functional
  from torchvision import transforms
  from einops import rearrange, reduce, repeat
label_desc: Use image node_id 1 to create a new EsViTTrainer object from inherited base classes: nn with example: obj = EsViTTrainer(net, image_size, hidden_layer, projection_hidden_size, num_classes_K, projection_layers, student_temp, teacher_temp, local_upper_crop_scale, global_lower_crop_scale, moving_average_decay, center_moving_average_decay, augment_fn, augment_fn2)