class_docstr: Compute CycleConsistency loss in COOT paper (Eq. 8)
  
  Args:
      clip_emb: Embeddings of clips
      clip_mask: Mask
      clip_lens: Number of clips per each video
      sentence_emb: Embeddings of sentences
      sentence_mask: Mask for input language
      sentence_lens: Number of sentences per paragraph
  
  Outputs:
      - ** clip to clip loss**: loss tensor with shape (batch_size,).
      - ** sentence to sentence loss**: loss tensor with shape (batch_size,).
class_docstr_tok: ["Compute","CycleConsistency","loss","in","COOT","paper","(","Eq",".","8",")","Args",":","clip_emb",":","Embeddings","of","clips","clip_mask",":","Mask","clip_lens",":","Number","of","clips","per","each","video","sentence_emb",":","Embeddings","of","sentences","sentence_mask",":","Mask","for","input","language","sentence_lens",":","Number","of","sentences","per","paragraph","Outputs",":","-","*","*","clip","to","clip","loss","*","*",":","loss","tensor","with","shape","(","batch_size",",",")",".","-","*","*","sentence","to","sentence","loss","*","*",":","loss","tensor","with","shape","(","batch_size",",",")","."]
code: def __init__(self, num_samples=-1, use_cuda=True):
      super().__init__()
      self.num_samples = num_samples
      self.use_cuda = use_cuda
      self.num_samples_tensor = torch.ones(1) * self.num_samples
      if self.use_cuda:
          self.num_samples_tensor = self.num_samples_tensor.cuda(
              non_blocking=True
          )
      self.loss_distance_fn = self._compute_mean_distance_l2
      self.proximity_fn = self._compute_mean_distance_negative_l2
      self.proximity_mask_val = -1e18
      self.softmax = nn.Softmax(dim=-1)
  
file_path: gluon-cv/gluoncv/torch/utils/loss.py
imports: from torch import nn
  import torch
label_desc: Use image node_id 1 to create a new CycleConsistencyCootLoss object from inherited base classes: nn with example: obj = CycleConsistencyCootLoss(num_samples, use_cuda)