code: def test_nnet(self):
      rng = np.random.RandomState(1827)
      data = rng.rand(10, 4)
      nnet = NNet(n_input=3, n_hidden=10)
      for epoch in range(3):
          mean_cost = 0
          for x in data:
              input = x[0:3]
              target = x[3:]
              output, cost = nnet.sgd_step(input, target)
              mean_cost += cost
          mean_cost /= float(len(data))
          # print 'Mean cost at epoch %s: %s' % (epoch, mean_cost)
      self.assertTrue(abs(mean_cost - 0.20588975452) < 1e-6)
      # Just call functions to make sure they do not crash.
      nnet.compute_output(input)
      nnet.output_from_hidden(np.ones(10))
  
file_path: Theano/theano/compile/tests/test_misc.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import unittest
  from theano.compile.pfunc import pfunc
  from theano.compile.sharedvalue import shared
  from theano import tensor
  from theano.tensor.nnet import sigmoid
label_desc: Use image node_id 1 for calling the TestNnet obj's underlying member method code with example usage: obj.test_nnet() without return types