class_docstr: Normalized Maximum Eigengap based Spectral Clustering (NME-SC)
  uses Eigengap analysis to get an estimated p-value for
  affinity binarization and an estimated number of speakers.
  
  p_value (also referred to as p_neighbors) is for taking
  top p number of affinity values and convert those to 1 while
  convert the rest of values to 0.
  
  p_value can be also tuned on a development set without performing
  NME-analysis. Fixing p_value brings about significantly faster clustering
  speed, but the performance is limited to the development set.
  
  References:
      Tae Jin Park et al., Auto-Tuning Spectral Clustering for Speaker Diarization
      Using Normalized Maximum Eigengap, IEEE Signal Processing Letters 27 (2019),
      https://arxiv.org/abs/2003.02405
  
  Args:
      Please refer to def __init__().
  
  Methods:
      NMEanalysis():
          Performs NME-analysis to estimate p_value and the number of speakers
      subsampleAffinityMat(nme_mat_size):
          Subsamples the number of speakers to reduce the computational load
      getPvalueList():
          Generates a list containing p-values that need to be examined.
      getEigRatio(p_neighbors):
          Calculates g_p, which is a ratio between p_neighbors and the maximum eigengap
      getLamdaGaplist(lambdas):
          Calculates lambda gap values from an array contains lambda values
      estimateNumofSpeakers(affinity_mat):
          Estimates the number of speakers using lambda gap list
class_docstr_tok: ["Normalized","Maximum","Eigengap","based","Spectral","Clustering","(","NME-SC",")","uses","Eigengap","analysis","to","get","an","estimated","p-value","for","affinity","binarization","and","an","estimated","number","of","speakers",".","p_value","(","also","referred","to","as","p_neighbors",")","is","for","taking","top","p","number","of","affinity","values","and","convert","those","to","1","while","convert","the","rest","of","values","to","0.","p_value","can","be","also","tuned","on","a","development","set","without","performing","NME-analysis",".","Fixing","p_value","brings","about","significantly","faster","clustering","speed",",","but","the","performance","is","limited","to","the","development","set",".","References",":","Tae","Jin","Park","et","al.",",","Auto-Tuning","Spectral","Clustering","for","Speaker","Diarization","Using","Normalized","Maximum","Eigengap",",","IEEE","Signal","Processing","Letters","27","(","2019",")",",","https",":","\/\/arxiv.org\/abs\/2003.02405","Args",":","Please","refer","to","def","__init__","(",")",".","Methods",":","NMEanalysis","(",")",":","Performs","NME-analysis","to","estimate","p_value","and","the","number","of","speakers","subsampleAffinityMat","(","nme_mat_size",")",":","Subsamples","the","number","of","speakers","to","reduce","the","computational","load","getPvalueList","(",")",":","Generates","a","list","containing","p-values","that","need","to","be","examined",".","getEigRatio","(","p_neighbors",")",":","Calculates","g_p",",","which","is","a","ratio","between","p_neighbors","and","the","maximum","eigengap","getLamdaGaplist","(","lambdas",")",":","Calculates","lambda","gap","values","from","an","array","contains","lambda","values","estimateNumofSpeakers","(","affinity_mat",")",":","Estimates","the","number","of","speakers","using","lambda","gap","list"]
docstr: Generates a p-value (p_neighbour) list for searching. p_value_list must include 2 (min_p_value)
  since at least one neighboring segment should be selected other than itself.
  
  If fixed_thres value is specified, then only one p-value is specified.
  If fixed_thres is not provided, multiple p-values are searched.
      If sparse_search is True:
          - Limit the number of p-values to be searched to sparse_search_volume.
          - N should be at least 2 to include a number greater than 1.
      If sparse_search is False:
          - Scan all the p_values from 1 to max_N
          - If sparse_search is False, NMESC analysis could take more time compared to sparse_search = True.
  
  Returns:
      p_value_list (Tensor):
          Tensor containing the p_values to be searched.
code: def getPvalueList(self) -> torch.Tensor:
      """
      Generates a p-value (p_neighbour) list for searching. p_value_list must include 2 (min_p_value)
      since at least one neighboring segment should be selected other than itself.
  
      If fixed_thres value is specified, then only one p-value is specified.
      If fixed_thres is not provided, multiple p-values are searched.
          If sparse_search is True:
              - Limit the number of p-values to be searched to sparse_search_volume.
              - N should be at least 2 to include a number greater than 1.
          If sparse_search is False:
              - Scan all the p_values from 1 to max_N
              - If sparse_search is False, NMESC analysis could take more time compared to sparse_search = True.
  
      Returns:
          p_value_list (Tensor):
              Tensor containing the p_values to be searched.
      """
      if self.fixed_thres is not None and self.fixed_thres > 0.0:
          self.max_N = torch.max(
              torch.floor(
                  torch.tensor(self.mat.shape[0] * self.fixed_thres)
              ).type(torch.int),
              self.min_p_value,
          )
          p_value_list = self.max_N.unsqueeze(0).int()
      else:
          self.max_N = torch.max(
              torch.floor(
                  torch.tensor(
                      self.mat.shape[0] * self.max_rp_threshold
                  )
              ).type(torch.int),
              self.min_p_value,
          )
          if self.sparse_search:
              search_volume = torch.min(
                  self.max_N,
                  torch.tensor(self.sparse_search_volume).type(
                      torch.int
                  ),
              )
              # search at least two values
              N = torch.max(search_volume, torch.tensor(2))
              # avoid repeating values by limiting the step size
              steps = min(self.max_N, N)
              p_value_list = torch.linspace(
                  start=1, end=self.max_N, steps=steps
              ).type(torch.int)
          else:
              p_value_list = torch.arange(1, self.max_N + 1)
      if p_value_list.shape[0] == 0:
          raise ValueError("p_value_list should not be empty.")
      return p_value_list
  
imports: from typing import Dict, List, Tuple
  import torch
  from torch.linalg import eigh, eigvalsh
label_desc: Use image node_id 5 for calling the NMESC obj's underlying member method code with example usage: obj.getPvalueList() and returns: p_value_list