Mercurial > pylearn
changeset 591:3f9ec536f2c1
Two minor fixes.
author | Joseph Turian <turian@iro.umontreal.ca> |
---|---|
date | Fri, 19 Dec 2008 16:46:51 -0500 |
parents | f8d29730f146 |
children | 8d0b73c7d768 c4579524baa6 |
files | pylearn/algorithms/cost.py pylearn/algorithms/logistic_regression.py |
diffstat | 2 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/pylearn/algorithms/cost.py Wed Dec 17 18:16:30 2008 -0500 +++ b/pylearn/algorithms/cost.py Fri Dec 19 16:46:51 2008 -0500 @@ -10,7 +10,6 @@ """ import theano.tensor as T -from xlogx import xlogx def quadratic(target, output, axis=1): return T.mean(T.sqr(target - output), axis=axis) @@ -28,5 +27,5 @@ different shapes then the result will be garbled. """ return -(target * T.log(output) + (1 - target) * T.log(1 - output)) \ - + (xlogx(target) + xlogx(1 - target)) + + (T.xlogx(target) + T.xlogx(1 - target)) # return cross_entropy(target, output, axis) - cross_entropy(target, target, axis)
--- a/pylearn/algorithms/logistic_regression.py Wed Dec 17 18:16:30 2008 -0500 +++ b/pylearn/algorithms/logistic_regression.py Fri Dec 19 16:46:51 2008 -0500 @@ -48,7 +48,7 @@ else: # TODO: when above is fixed, remove this hack (need an argmax # which is independent of targets) - self.argmax_standalone = T.argmax(self.linear_output); + self.argmax_standalone = T.argmax(self.linear_output) (self._xent, self.softmax, self._max_pr, self.argmax) =\ nnet.crossentropy_softmax_max_and_argmax_1hot( self.linear_output, self.target)