changeset 199:777f48ba30df

Add MSE cost to log_reg.py
author Arnaud Bergeron <abergeron@gmail.com>
date Tue, 02 Mar 2010 18:43:54 -0500
parents 5d88ed99c0af
children 3f2cc90ad51c
files baseline/log_reg/log_reg.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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