diff _nnet_ops.py @ 24:2e8be9f5412b

added nnet_ops
author bergstrj@iro.umontreal.ca
date Thu, 10 Apr 2008 17:25:13 -0400
parents
children b63e8c0bf21b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/_nnet_ops.py	Thu Apr 10 17:25:13 2008 -0400
@@ -0,0 +1,27 @@
+
+import unittest
+import theano._test_tensor as TT
+import numpy
+
+from nnet_ops import *
+
+class T_sigmoid(unittest.TestCase):
+    def setUp(self):
+        numpy.random.seed(9999)
+    def test_elemwise(self):
+        TT.verify_grad(self, Sigmoid, [numpy.random.rand(3,4)])
+
+
+class T_CrossentropySoftmax1Hot(unittest.TestCase):
+    def setUp(self):
+        numpy.random.seed(9999)
+    def test0(self):
+        y_idx = [0,1,3]
+        def output1(a):
+            return cross_entropy_softmax_1hot(a, y_idx)[0:1]
+        TT.verify_grad(self, output1, [numpy.random.rand(3,4)])
+
+
+
+if __name__ == '__main__':
+    unittest.main()