# HG changeset patch # User Arnaud Bergeron # Date 1267573434 18000 # Node ID 777f48ba30df3261a52dd3b46cf3ddcfbcb18a61 # Parent 5d88ed99c0af2cde30d490f388358c127f091946 Add MSE cost to log_reg.py diff -r 5d88ed99c0af -r 777f48ba30df baseline/log_reg/log_reg.py --- a/baseline/log_reg/log_reg.py Tue Mar 02 18:16:49 2010 -0500 +++ b/baseline/log_reg/log_reg.py Tue Mar 02 18:43:54 2010 -0500 @@ -112,6 +112,8 @@ # i.e., the mean log-likelihood across the minibatch. return -T.mean( T.log( self.p_y_given_x )[ T.arange( y.shape[0] ), y ] ) + def MSE(self, y): + return -T.mean(abs((self.p_t_given_x)[T.arange(y.shape[0]), y]-y)**2) def errors( self, y ): """Return a float representing the number of errors in the minibatch