class_docstr: A class to train PLDA model from embeddings.
  
  The input is in speechbrain.utils.StatObject_SB format.
  Trains a simplified PLDA model no within-class covariance matrix but full residual covariance matrix.
  
  Arguments
  ---------
  mean : tensor
      Mean of the vectors.
  F : tensor
      Eigenvoice matrix.
  Sigma : tensor
      Residual matrix.
  
  Example
  -------
  >>> from speechbrain.processing.PLDA_LDA import *
  >>> import random, numpy
  >>> dim, N = 10, 100
  >>> n_spkrs = 10
  >>> train_xv = numpy.random.rand(N, dim)
  >>> md = ['md'+str(random.randrange(1,n_spkrs,1)) for i in range(N)]
  >>> modelset = numpy.array(md, dtype="|O")
  >>> sg = ['sg'+str(i) for i in range(N)]
  >>> segset = numpy.array(sg, dtype="|O")
  >>> s = numpy.array([None] * N)
  >>> stat0 = numpy.array([[1.0]]* N)
  >>> xvectors_stat = StatObject_SB(modelset=modelset, segset=segset, start=s, stop=s, stat0=stat0, stat1=train_xv)
  >>> # Training PLDA model: M ~ (mean, F, Sigma)
  >>> plda = PLDA(rank_f=5)
  >>> plda.plda(xvectors_stat)
  >>> print (plda.mean.shape)
  (10,)
  >>> print (plda.F.shape)
  (10, 5)
  >>> print (plda.Sigma.shape)
  (10, 10)
  >>> # Enrollment (20 utts), Test (30 utts)
  >>> en_N = 20
  >>> en_xv = numpy.random.rand(en_N, dim)
  >>> en_sgs = ['en'+str(i) for i in range(en_N)]
  >>> en_sets = numpy.array(en_sgs, dtype="|O")
  >>> en_s = numpy.array([None] * en_N)
  >>> en_stat0 = numpy.array([[1.0]]* en_N)
  >>> en_stat = StatObject_SB(modelset=en_sets, segset=en_sets, start=en_s, stop=en_s, stat0=en_stat0, stat1=en_xv)
  >>> te_N = 30
  >>> te_xv = numpy.random.rand(te_N, dim)
  >>> te_sgs = ['te'+str(i) for i in range(te_N)]
  >>> te_sets = numpy.array(te_sgs, dtype="|O")
  >>> te_s = numpy.array([None] * te_N)
  >>> te_stat0 = numpy.array([[1.0]]* te_N)
  >>> te_stat = StatObject_SB(modelset=te_sets, segset=te_sets, start=te_s, stop=te_s, stat0=te_stat0, stat1=te_xv)
  >>> ndx = Ndx(models=en_sets, testsegs=te_sets)
  >>> # PLDA Scoring
  >>> scores_plda = fast_PLDA_scoring(en_stat, te_stat, ndx, plda.mean, plda.F, plda.Sigma)
  >>> print (scores_plda.scoremat.shape)
  (20, 30)
code: def __init__(
      self,
      mean=None,
      F=None,
      Sigma=None,
      rank_f=100,
      nb_iter=10,
      scaling_factor=1.0,
  ):
      self.mean = None
      self.F = None
      self.Sigma = None
      self.rank_f = rank_f
      self.nb_iter = nb_iter
      self.scaling_factor = scaling_factor
  
      if mean is not None:
          self.mean = mean
      if F is not None:
          self.F = F
      if Sigma is not None:
          self.Sigma = Sigma
  
imports: import numpy
  import copy
  import pickle
  from scipy import linalg
label_desc: Use image node_id 1 to create a new PLDA object  with example: obj = PLDA(mean, F, Sigma, rank_f, nb_iter, scaling_factor)