code: def compute_metrics(logits, labels, weights):
      """Compute summary metrics."""
      loss, weight_sum = compute_weighted_cross_entropy(
          logits, labels, weights
      )
      acc, _ = compute_weighted_accuracy(logits, labels, weights)
      metrics = {
          "loss": loss,
          "accuracy": acc,
          "denominator": weight_sum,
      }
      metrics = np.sum(metrics, -1)
      return metrics
  
imports: import functools
  import os
  import time
  from absl import app
  from absl import flags
  from absl import logging
  from flax import jax_utils
  from flax import linen
  from flax.metrics import tensorboard
  from flax.training import common_utils
  from flax.training import train_state
  import jax
  import jax.numpy
  from jax import random
  import numpy
  import optax
  import tensorflow
  import input_pipeline
  import models
label_desc: Use image node_id 4 for calling a global function with example usage: compute_metrics(logits, labels, weights) and returns: metrics