docstr: This just sees if things compile well and if they run 
docstr_tok: ["This","just","sees","if","things","compile","well","and","if","they","run"]
code: def test_scipy_paper_example2(self):
      """This just sees if things compile well and if they run"""
      # PREAMPBLE
      T = theano.tensor
      shared = theano.shared
      function = theano.function
      rng = numpy.random
      theano.config.floatX = "float64"
  
      #
      # ACTUAL SCRIPT FROM PAPER
  
      x = T.matrix()
      y = T.vector()
      w = shared(rng.randn(100))
      b = shared(np.zeros(()))
  
      # Construct Theano expression graph
      p_1 = 1 / (1 + T.exp(-T.dot(x, w) - b))
      xent = -y * T.log(p_1) - (1 - y) * T.log(1 - p_1)
      prediction = p_1 > 0.5
      cost = xent.mean() + 0.01 * (w**2).sum()
      gw, gb = T.grad(cost, [w, b])
  
      # Compile expressions to functions
      train = function(
          inputs=[x, y],
          outputs=[prediction, xent],
          updates=[(w, w - 0.1 * gw), (b, b - 0.1 * gb)],
      )
      function(inputs=[x], outputs=prediction)
  
      N = 4
      feats = 100
      D = (rng.randn(N, feats), rng.randint(size=4, low=0, high=2))
      training_steps = 10
      for i in range(training_steps):
          pred, err = train(D[0], D[1])
  
file_path: Theano/theano/tests/diverse_tests.py
imports: from __future__ import absolute_import, print_function, division
  import unittest
  import numpy
  import numpy.random
  import theano
  from theano.tests import unittest_tools
label_desc: Use image node_id 4 for calling the T_scipy obj's underlying member method code with example usage: obj.test_scipy_paper_example2() without return types