code: def test_nnet():
      rng = np.random.default_rng(279)
      data = rng.random((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)
      # Seed based test
      assert abs(mean_cost - 0.2301901) < 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: pytensor/tests/compile/test_misc.py
imports: import numpy
  from pytensor.compile.function.pfunc import pfunc
  from pytensor.compile.sharedvalue import shared
  from pytensor.gradient import grad
  from pytensor.tensor.math import dot, sigmoid
  from pytensor.tensor.math import sum
  from pytensor.tensor.type import dvector
label_desc: Use image node_id 1 for calling a global function with example usage: test_nnet() without return types