# HG changeset patch # User Frederic Bastien # Date 1212774959 14400 # Node ID 2ee53bae9ee0a1666505c2567f3d34863ec9eb3e # Parent 23981827b7942ed470b744cc9d4b3f0028f25bcf renamed _nnet_ops.py to _test_nnet_opt.py to be used with autotest diff -r 23981827b794 -r 2ee53bae9ee0 _nnet_ops.py --- a/_nnet_ops.py Fri Jun 06 13:53:02 2008 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ - -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_softplus(unittest.TestCase): - def setUp(self): - numpy.random.seed(9999) - def test_elemwise(self): - TT.verify_grad(self, softplus, [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] - class Dummy(object): - def make_node(self, a,b): - return crossentropy_softmax_1hot_with_bias(a, b, y_idx)[0:1] - TT.verify_grad(self, Dummy(), [numpy.random.rand(3,4), - numpy.random.rand(4)]) - - def test1(self): - y_idx = [0,1,3] - class Dummy(object): - def make_node(self, a): - return crossentropy_softmax_1hot(a, y_idx)[0:1] - TT.verify_grad(self, Dummy(), [numpy.random.rand(3,4)]) - - - -if __name__ == '__main__': - unittest.main() diff -r 23981827b794 -r 2ee53bae9ee0 _test_nnet_ops.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/_test_nnet_ops.py Fri Jun 06 13:55:59 2008 -0400 @@ -0,0 +1,41 @@ + +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_softplus(unittest.TestCase): + def setUp(self): + numpy.random.seed(9999) + def test_elemwise(self): + TT.verify_grad(self, softplus, [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] + class Dummy(object): + def make_node(self, a,b): + return crossentropy_softmax_1hot_with_bias(a, b, y_idx)[0:1] + TT.verify_grad(self, Dummy(), [numpy.random.rand(3,4), + numpy.random.rand(4)]) + + def test1(self): + y_idx = [0,1,3] + class Dummy(object): + def make_node(self, a): + return crossentropy_softmax_1hot(a, y_idx)[0:1] + TT.verify_grad(self, Dummy(), [numpy.random.rand(3,4)]) + + + +if __name__ == '__main__': + unittest.main()