code: def test_binary_hinge_loss_sigmoid_predictions():
      from lasagne.objectives import binary_hinge_loss
  
      p = theano.tensor.vector("p")
      t = theano.tensor.ivector("t")
      c = binary_hinge_loss(p, t, log_odds=False)
      # numeric version
      floatX = theano.config.floatX
      predictions = np.random.rand(
          10,
      ).astype(floatX)
      targets = np.random.random_integers(0, 1, (10,)).astype("int8")
      targets2 = 2 * targets - 1
      hinge = np.maximum(
          0, 1 - np.log(predictions / (1 - predictions)) * targets2
      )
      # compare
      assert np.allclose(hinge, c.eval({p: predictions, t: targets}))
  
imports: import numpy
  import theano
  import pytest
label_desc: Use image node_id 15 for calling a global function with example usage: test_binary_hinge_loss_sigmoid_predictions() without return types