docstr: Given the network predictions and targets computed the binary CE
docstr_tok: ["Given","the","network","predictions","and","targets","computed","the","binary","CE"]
code: def compute_objectives(self, predictions, batch, stage=True):
      "Given the network predictions and targets computed the binary CE"
      predictions, lens = predictions
  
      targets, lens = batch.target
      targets = targets.to(predictions.device)
      predictions = predictions[:, : targets.shape[-1], 0]
      loss = self.hparams.compute_BCE_cost(
          torch.nn.BCEWithLogitsLoss(reduction="none"),
          predictions,
          targets,
          lens,
      )
  
      # compute metrics
      self.binary_metrics.append(
          batch.id, torch.sigmoid(predictions), targets
      )
  
      return loss
  
file_path: speechbrain/tests/integration/VAD/example_vad.py
imports: import os
  import torch
  import numpy
  import speechbrain
  from hyperpyyaml import load_hyperpyyaml
label_desc: Use image node_id 2 for calling the VADBrain obj's underlying member method code with example usage: obj.compute_objectives(predictions, batch, stage) and returns: loss