code: def _BinaryCrossEntropy():
      """Returns a layer that computes prediction-target cross entropies."""
  
      def f(
          model_output, target_category
      ):  # pylint: disable=invalid-name
          shapes.assert_same_shape(model_output, target_category)
          batch_size = model_output.shape[0]
          j = jnp.dot(
              jnp.transpose(target_category), jnp.log(model_output)
          )
          j += jnp.dot(
              jnp.transpose(1 - target_category),
              jnp.log(1 - model_output),
          )
          j = -1.0 / batch_size * jnp.squeeze(j)
          return j
  
      return base.Fn("_BinaryCrossEntropy", f)
  
imports: from trax import fastmath
  from trax import shapes
  from trax.fastmath import numpy
  from trax.layers import base
  from trax.layers import combinators
  from trax.layers import core
label_desc: Use image node_id 23 for calling a global function with example usage: _BinaryCrossEntropy() and returns: base, j