Mercurial > pylearn
diff _nnet_ops.py @ 70:76e5c0f37165
better docs & precondition testing for cross_entropy_softmax_1hot & friends
author | James Bergstra <bergstrj@iro.umontreal.ca> |
---|---|
date | Fri, 02 May 2008 18:19:15 -0400 |
parents | 8c2607f387e6 |
children | 3ef569b92fba |
line wrap: on
line diff
--- a/_nnet_ops.py Mon Apr 21 15:23:49 2008 -0400 +++ b/_nnet_ops.py Fri May 02 18:19:15 2008 -0400 @@ -23,10 +23,16 @@ def test0(self): y_idx = [0,1,3] def output1(a,b): - return crossentropy_softmax_1hot(a, b, y_idx)[0:1] + return crossentropy_softmax_1hot_with_bias(a, b, y_idx)[0:1] TT.verify_grad(self, output1, [numpy.random.rand(3,4), numpy.random.rand(4)]) + def test1(self): + y_idx = [0,1,3] + def output1(a): + return crossentropy_softmax_1hot(a, y_idx)[0:1] + TT.verify_grad(self, output1, [numpy.random.rand(3,4)]) + if __name__ == '__main__':