class_docstr: Tests the metric computation related utilities.
class_docstr_tok: ["Tests","the","metric","computation","related","utilities","."]
docstr: Tests the unnormalized sigmoid cross entropy computation.
docstr_tok: ["Tests","the","unnormalized","sigmoid","cross","entropy","computation","."]
code: def test_weighted_unnormalized_sigmoid_cross_entropy(
      self, label_multiplier, weight_multiplier
  ):
      """Tests the unnormalized sigmoid cross entropy computation."""
      batch_size = 512
      num_of_classes = 100
      logits = jnp.array(
          np.random.normal(size=(batch_size, num_of_classes)),
          dtype=jnp.float32,
      )
      labels = jnp.array(
          np.random.randint(0, 2, size=(batch_size, num_of_classes))
      )
      labels *= label_multiplier
  
      weights = jnp.ones(shape=(batch_size,), dtype=jnp.float32)
      weights *= weight_multiplier
  
      loss_array = (
          model_utils.weighted_unnormalized_sigmoid_cross_entropy(
              logits, labels, weights=weights
          )
      )
      loss_sum = jnp.sum(loss_array)
  
      self.is_valid(loss_sum, "Loss value")
  
imports: import itertools
  from absl.testing import absltest
  from absl.testing import parameterized
  from flax.training import common_utils
  import jax
  import jax.numpy
  import numpy
  from scenic.model_lib.base_models import model_utils
label_desc: Use image node_id 5 for calling the MetricTest obj's underlying member method code with example usage: obj.test_weighted_unnormalized_sigmoid_cross_entropy(label_multiplier, weight_multiplier) without return types