Mercurial > pylearn
view _nnet_ops.py @ 42:9b68774fcc6b
Testing basic functionality and removing obvious bugs
author | bengioy@grenat.iro.umontreal.ca |
---|---|
date | Fri, 25 Apr 2008 16:00:31 -0400 |
parents | bf0145fa73e8 |
children | 8c2607f387e6 |
line wrap: on
line source
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,b): return crossentropy_softmax_1hot(a, b, y_idx)[0:1] TT.verify_grad(self, output1, [numpy.random.rand(3,4), numpy.random.rand(4)]) if __name__ == '__main__': unittest.main()