code: def test_binary_crossentropy(colvect):
      # symbolic version
      from lasagne.objectives import binary_crossentropy
  
      if not colvect:
          p, t = theano.tensor.matrices("pt")
          c = binary_crossentropy(p, t)
      else:
          # check that for convenience, comparing a prediction column vector
          # against a 1D target vector does not lead to broadcasting
          p, t = theano.tensor.vectors("pt")
          c = binary_crossentropy(p.dimshuffle(0, "x"), t)[:, 0]
      # numeric version
      floatX = theano.config.floatX
      shape = (10, 20) if not colvect else (10,)
      predictions = np.random.rand(*shape).astype(floatX)
      targets = np.random.rand(*shape).astype(floatX)
      crossent = -targets * np.log(predictions) - (
          1 - targets
      ) * np.log(1 - predictions)
      # compare
      assert np.allclose(crossent, c.eval({p: predictions, t: targets}))
  
imports: import numpy
  import theano
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_binary_crossentropy(colvect) without return types