code: def test_accuracy_binary_classifier(self):
      layer = tl.Accuracy(classifier=tl.ThresholdToBinary())
      targets = np.array([[0, 0, 1, 1], [1, 1, 1, 0]])
      weights = np.ones_like(targets)
  
      model_outputs = np.array(
          [[0.499, 0.500, 0.501, 0.502], [0.503, 0.502, 0.501, 0.500]]
      )
      accuracy = layer([model_outputs, targets, weights])
      self.assertEqual(accuracy, 1.0)
  
      model_outputs = np.array(
          [[0.498, 0.499, 0.500, 0.501], [0.502, 0.501, 0.500, 0.499]]
      )
      accuracy = layer([model_outputs, targets, weights])
      self.assertEqual(accuracy, 0.75)
  
imports: from absl.testing import absltest
  import numpy
  import trax.layers
label_desc: Use image node_id 12 for calling the MetricsTest obj's underlying member method code with example usage: obj.test_accuracy_binary_classifier() without return types