Mercurial > pylearn
annotate _nnet_ops.py @ 29:46c5c90019c2
Changed apply_function so that it propagates methods of the source.
author | bengioy@grenat.iro.umontreal.ca |
---|---|
date | Fri, 11 Apr 2008 15:46:18 -0400 |
parents | b63e8c0bf21b |
children | bf0145fa73e8 |
rev | line source |
---|---|
24 | 1 |
2 import unittest | |
3 import theano._test_tensor as TT | |
4 import numpy | |
5 | |
6 from nnet_ops import * | |
7 | |
8 class T_sigmoid(unittest.TestCase): | |
9 def setUp(self): | |
10 numpy.random.seed(9999) | |
11 def test_elemwise(self): | |
12 TT.verify_grad(self, Sigmoid, [numpy.random.rand(3,4)]) | |
13 | |
14 | |
15 class T_CrossentropySoftmax1Hot(unittest.TestCase): | |
16 def setUp(self): | |
17 numpy.random.seed(9999) | |
18 def test0(self): | |
19 y_idx = [0,1,3] | |
20 def output1(a): | |
25
b63e8c0bf21b
added __init__.py, fixed crossentropy_softmax_1hot function name
bergstrj@iro.umontreal.ca
parents:
24
diff
changeset
|
21 return crossentropy_softmax_1hot(a, y_idx)[0:1] |
24 | 22 TT.verify_grad(self, output1, [numpy.random.rand(3,4)]) |
23 | |
24 | |
25 | |
26 if __name__ == '__main__': | |
27 unittest.main() |