class_docstr: Base model for object detection with matching.
class_docstr_tok: ["Base","model","for","object","detection","with","matching","."]
docstr: Implements the matching cost matrix computations.
  
  Args:
    predictions: Dictionary of outputs from a model. Must contain 'pred_boxes'
      and 'pred_probs' keys with shapes [B, N, 4] and [B, N, L] respectively.
    targets: Dictionary of ground truth targets. Must contain 'boxes' and
      'labels' keys of shapes [B, M, 4] and [B, M, L] respectively.
  
  Returns:
    The matching cost matrix of shape [B, N, M].
    Number of unpadded columns per batch element [B].
docstr_tok: ["Implements","the","matching","cost","matrix","computations",".","Args",":","predictions",":","Dictionary","of","outputs","from","a","model",".","Must","contain","'pred_boxes'","and","'pred_probs","'","keys","with","shapes","[","B",",","N",",","4","]","and","[","B",",","N",",","L","]","respectively",".","targets",":","Dictionary","of","ground","truth","targets",".","Must","contain","'boxes","'","and","'labels","'","keys","of","shapes","[","B",",","M",",","4","]","and","[","B",",","M",",","L","]","respectively",".","Returns",":","The","matching","cost","matrix","of","shape","[","B",",","N",",","M","]",".","Number","of","unpadded","columns","per","batch","element","[","B","]","."]
code: def compute_cost_matrix(
      self, predictions: ArrayDict, targets: ArrayDict
  ) -> jnp.ndarray:
      """Implements the matching cost matrix computations.
  
      Args:
        predictions: Dictionary of outputs from a model. Must contain 'pred_boxes'
          and 'pred_probs' keys with shapes [B, N, 4] and [B, N, L] respectively.
        targets: Dictionary of ground truth targets. Must contain 'boxes' and
          'labels' keys of shapes [B, M, 4] and [B, M, L] respectively.
  
      Returns:
        The matching cost matrix of shape [B, N, M].
        Number of unpadded columns per batch element [B].
      """
      return losses_lib.compute_cost(
          tgt_labels=targets["labels"],
          out_logits=predictions["pred_logits"],
          tgt_bbox=targets["boxes"],
          out_bbox=predictions["pred_boxes"],
          class_loss_coef=self.config.class_loss_coef,
          bbox_loss_coef=self.config.bbox_loss_coef,
          giou_loss_coef=self.config.giou_loss_coef,
          focal_loss=self.config.focal_loss,
          focal_alpha=self.config.get("focal_alpha"),
          focal_gamma=self.config.get("focal_gamma"),
      )
  
imports: import abc
  import functools
  from typing import Any, Callable, Dict, Optional, Tuple
  import jax
  import jax.numpy
  import ml_collections
  from scenic.model_lib import matchers
  from scenic.model_lib.base_models import base_model
  from scenic.model_lib.base_models import box_utils
  from scenic.model_lib.base_models import model_utils
  from scenic.projects.owl_vit import losses
label_desc: Use image node_id 3 for calling the ObjectDetectionModel obj's underlying member method code with example usage: obj.compute_cost_matrix(predictions, targets) and returns: losses_lib