class_docstr: Class for speaker embedding training
docstr: Computes the loss using speaker-id as label.
docstr_tok: ["Computes","the","loss","using","speaker-id","as","label","."]
code: def compute_objectives(self, predictions, batch, stage):
      """Computes the loss using speaker-id as label."""
      predictions, lens = predictions
      uttid = batch.id
      spkid, _ = batch.spk_id_encoded
  
      # Concatenate labels (due to data augmentation)
      if stage == sb.Stage.TRAIN and hasattr(
          self.hparams, "wav_augment"
      ):
          spkid = self.hparams.wav_augment.replicate_labels(spkid)
  
      loss = self.hparams.compute_cost(predictions, spkid, lens)
  
      if stage == sb.Stage.TRAIN and hasattr(
          self.hparams.lr_annealing, "on_batch_end"
      ):
          self.hparams.lr_annealing.on_batch_end(self.optimizer)
  
      if stage != sb.Stage.TRAIN:
          self.error_metrics.append(uttid, predictions, spkid, lens)
  
      return loss
  
file_path: speechbrain/recipes/VoxCeleb/SpeakerRec/train_speaker_embeddings.py
imports: import os
  import sys
  import random
  import torch
  import torchaudio
  import speechbrain
  from speechbrain.utils.data_utils import download_file
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.distributed import run_on_main
label_desc: Use image node_id 2 for calling the SpeakerBrain obj's underlying member method code with example usage: obj.compute_objectives(predictions, batch, stage) and returns: loss