comparison mlp.py @ 155:ae5651a3696b

new argmax calling convention
author James Bergstra <bergstrj@iro.umontreal.ca>
date Mon, 12 May 2008 16:16:32 -0400
parents 3f4e5c9bdc5e
children e9a95e19e6f8 4090779e39a9
comparison
equal deleted inserted replaced
151:39bb21348fdf 155:ae5651a3696b
87 self._b1 = t.row('b1') 87 self._b1 = t.row('b1')
88 self._b2 = t.row('b2') 88 self._b2 = t.row('b2')
89 self._regularization_term = self._L2_regularizer * (t.sum(self._W1*self._W1) + t.sum(self._W2*self._W2)) 89 self._regularization_term = self._L2_regularizer * (t.sum(self._W1*self._W1) + t.sum(self._W2*self._W2))
90 self._output_activations =self._b2+t.dot(t.tanh(self._b1+t.dot(self._input,self._W1.T)),self._W2.T) 90 self._output_activations =self._b2+t.dot(t.tanh(self._b1+t.dot(self._input,self._W1.T)),self._W2.T)
91 self._nll,self._output = crossentropy_softmax_1hot(self._output_activations,self._target_vector) 91 self._nll,self._output = crossentropy_softmax_1hot(self._output_activations,self._target_vector)
92 self._output_class, self._max_output = t.argmax(self._output,1) 92 self._output_class = t.argmax(self._output,1)
93 self._class_error = t.neq(self._output_class,self._target_vector) 93 self._class_error = t.neq(self._output_class,self._target_vector)
94 self._minibatch_criterion = self._nll + self._regularization_term / t.shape(self._input)[0] 94 self._minibatch_criterion = self._nll + self._regularization_term / t.shape(self._input)[0]
95 OnlineGradientTLearner.__init__(self) 95 OnlineGradientTLearner.__init__(self)
96 96
97 def attributeNames(self): 97 def attributeNames(self):