class_docstr: Perform spectral clustering by calculating spectral embeddings then run k-means clustering
  algorithm on the spectral embeddings.
class_docstr_tok: ["Perform","spectral","clustering","by","calculating","spectral","embeddings","then","run","k-means","clustering","algorithm","on","the","spectral","embeddings","."]
docstr: Initialize the variables needed for spectral clustering and k-means++.
  
  Args:
      n_clusters (int):
          Number of the estimated (or oracle) number of speakers
      random_state (int):
          Random seed that determines a random state of k-means initialization.
      n_random_trials (int):
          Number of trials with different random seeds for k-means initialization.
          k-means++ algorithm is executed for multiple times then the final result
          is obtained by taking a majority vote.
      cuda (bool):
          if cuda=True, spectral clustering is done on GPU.
      device (torch.device):
          Torch device variable
code: def __init__(
      self,
      n_clusters: int = 8,
      random_state: int = 0,
      n_random_trials: int = 1,
      cuda: bool = False,
      device: torch.device = torch.device("cpu"),
  ):
      """
      Initialize the variables needed for spectral clustering and k-means++.
  
      Args:
          n_clusters (int):
              Number of the estimated (or oracle) number of speakers
          random_state (int):
              Random seed that determines a random state of k-means initialization.
          n_random_trials (int):
              Number of trials with different random seeds for k-means initialization.
              k-means++ algorithm is executed for multiple times then the final result
              is obtained by taking a majority vote.
          cuda (bool):
              if cuda=True, spectral clustering is done on GPU.
          device (torch.device):
              Torch device variable
      """
      self.n_clusters = n_clusters
      self.random_state = random_state
      self.n_random_trials = max(n_random_trials, 1)
      self.cuda = cuda
      self.device = device
  
imports: from typing import Dict, List, Tuple
  import torch
  from torch.linalg import eigh, eigvalsh
label_desc: Use image node_id 1 to create a new SpectralClustering object  with example: obj = SpectralClustering(n_clusters, random_state, n_random_trials, cuda, device)