comparison pylearn/algorithms/logistic_regression.py @ 591:3f9ec536f2c1

Two minor fixes.
author Joseph Turian <turian@iro.umontreal.ca>
date Fri, 19 Dec 2008 16:46:51 -0500
parents e878003c3009
children bd777e960c7c
comparison
equal deleted inserted replaced
590:f8d29730f146 591:3f9ec536f2c1
46 self._max_pr, self.argmax = T.max_and_argmax(self.linear_output) 46 self._max_pr, self.argmax = T.max_and_argmax(self.linear_output)
47 self._xent = self.target * T.log(self.softmax) 47 self._xent = self.target * T.log(self.softmax)
48 else: 48 else:
49 # TODO: when above is fixed, remove this hack (need an argmax 49 # TODO: when above is fixed, remove this hack (need an argmax
50 # which is independent of targets) 50 # which is independent of targets)
51 self.argmax_standalone = T.argmax(self.linear_output); 51 self.argmax_standalone = T.argmax(self.linear_output)
52 (self._xent, self.softmax, self._max_pr, self.argmax) =\ 52 (self._xent, self.softmax, self._max_pr, self.argmax) =\
53 nnet.crossentropy_softmax_max_and_argmax_1hot( 53 nnet.crossentropy_softmax_max_and_argmax_1hot(
54 self.linear_output, self.target) 54 self.linear_output, self.target)
55 55
56 self.unregularized_cost = T.sum(self._xent) 56 self.unregularized_cost = T.sum(self._xent)