docstr: Calculates the GE2E loss for an input of dimensions (num_speakers, num_utts_per_speaker, dvec_feats)
docstr_tok: ["Calculates","the","GE2E","loss","for","an","input","of","dimensions","(","num_speakers",",","num_utts_per_speaker",",","dvec_feats",")"]
code: def forward(self, dvecs):
      """
      Calculates the GE2E loss for an input of dimensions (num_speakers, num_utts_per_speaker, dvec_feats)
      """
      centroids = torch.mean(dvecs, 1)
      cos_sim_matrix = self.calc_cosine_sim(dvecs, centroids)
      torch.clamp(self.w, 1e-6)
      cos_sim_matrix = self.w * cos_sim_matrix + self.b
      L = self.embed_loss(dvecs, cos_sim_matrix)
      return L.mean()
  
file_path: TTS/TTS/speaker_encoder/losses.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  import numpy
label_desc: Use image node_id 6 for calling the GE2ELoss obj's underlying member method code with example usage: obj.forward(dvecs) and returns: L