diff sandbox/rbm/model.py @ 410:3cd4cfda2599

XENT per instance
author Joseph Turian <turian@gmail.com>
date Fri, 11 Jul 2008 01:33:27 -0400
parents c2e6a8fcc35e
children 4f61201fa9a9
line wrap: on
line diff
--- a/sandbox/rbm/model.py	Thu Jul 10 17:33:28 2008 -0400
+++ b/sandbox/rbm/model.py	Fri Jul 11 01:33:27 2008 -0400
@@ -89,7 +89,7 @@
         """
         minibatch = len(instances)
         v0 = pylearn.sparse_instance.to_vector(instances, self.input_dimension)
-        print "old XENT:", numpy.sum(self.deterministic_reconstruction_error(v0))
+        print "old XENT per instance:", numpy.sum(self.deterministic_reconstruction_error(v0))/minibatch
         q0 = sigmoid(self.parameters.b + dot(v0, self.parameters.w))
         h0 = sample(q0)
         p0 = sigmoid(self.parameters.c + dot(h0, self.parameters.w.T))
@@ -110,7 +110,7 @@
         self.last_db = db
         self.last_dc = dc
 
-        print "new XENT:", numpy.sum(self.deterministic_reconstruction_error(v0))
+        print "new XENT per instance:", numpy.sum(self.deterministic_reconstruction_error(v0))/minibatch
 
 #        print
 #        print "v[0]:", v0