code: def _cluster_features(self, features: torch.Tensor) -> torch.Tensor:
      # clusters the features using sklearn
      # (note: faiss is probably more efficient)
      features = features.cpu().numpy()
      kmeans = KMeans(self.n_groups).fit(features)
      clustered = torch.from_numpy(kmeans.cluster_centers_).float()
      clustered = torch.nn.functional.normalize(clustered, dim=1)
      return clustered
  
file_path: lightly/examples/pytorch/smog.py
imports: import copy
  import torch
  import torchvision
  from sklearn.cluster import KMeans
  from torch import nn
  from lightly.models import utils
  from lightly.models.modules.heads import SMoGPredictionHead, SMoGProjectionHead, SMoGPrototypes
  from lightly.models.modules.memory_bank import MemoryBankModule
  from lightly.transforms.smog_transform import SMoGTransform
label_desc: Use image node_id 2 for calling the SMoGModel obj's underlying member method code with example usage: obj._cluster_features(features) and returns: clustered