code: def baseline_nce(
      encoded_video: jnp.ndarray,
      encoded_text: jnp.ndarray,
      temperature: float = 0.05,
      v2t_weight: float = 1.0,
      t2v_weight: float = 1.0,
      beta: float = 0.0,
  ) -> float:
      """Returns HN-NCE loss when *not* considering verb hard negatives."""
      # Logits are [VIDEO x TEXT]
      logits = (
          utils.compute_inners(encoded_video, encoded_text)
          / temperature
      )
  
      # Video to text loss
      loss_v2t = hn_nce_loss_without_hardnegs(logits, beta=beta)
      loss_v2t = jnp.mean(loss_v2t)
  
      # Text to video loss
      logits_t = jnp.transpose(logits)  # [TEXT x VIDEO]
      n = logits_t.shape[-1] - 1
      loss_t2v = hn_nce_loss_without_hardnegs(logits_t, beta=beta, n=n)
      loss_t2v = jnp.mean(loss_t2v)
  
      loss_final = v2t_weight * loss_v2t + t2v_weight * loss_t2v
      return loss_final
  
file_path: scenic/scenic/projects/verbs_in_action/losses.py
imports: from typing import Tuple
  import flax.linen
  import jax.numpy
  import numpy
  from scenic.projects.verbs_in_action import utils
label_desc: Use image node_id 1 for calling a global function with example usage: baseline_nce(encoded_video, encoded_text, temperature, v2t_weight, t2v_weight, beta) and returns: loss_final