diff sparse_random_autoassociator/graph.py @ 384:edec18614a70

Switched back to margin loss
author Joseph Turian <turian@gmail.com>
date Tue, 08 Jul 2008 02:00:00 -0400
parents 344d1f874af7
children
line wrap: on
line diff
--- a/sparse_random_autoassociator/graph.py	Tue Jul 08 01:59:42 2008 -0400
+++ b/sparse_random_autoassociator/graph.py	Tue Jul 08 02:00:00 2008 -0400
@@ -29,9 +29,9 @@
 # xnonzero sensitive loss:
 #nonzeroloss = hingeloss(ynonzero - t.max(yzero) - MARGIN - xnonzero)
 #zeroloss = hingeloss(-t.max(-(ynonzero - xnonzero)) - yzero - MARGIN)
-#loss = t.sum(nonzeroloss) + t.sum(zeroloss)
+loss = t.sum(nonzeroloss) + t.sum(zeroloss)
 
-loss = t.sum(binary_crossentropy(ynonzero, xnonzero)) + t.sum(binary_crossentropy(yzero, t.constant(0)))
+#loss = t.sum(binary_crossentropy(ynonzero, xnonzero)) + t.sum(binary_crossentropy(yzero, t.constant(0)))
 
 (gw1nonzero, gb1, gw2nonzero, gw2zero, gb2nonzero, gb2zero) = t.grad(loss, [w1nonzero, b1, w2nonzero, w2zero, b2nonzero, b2zero])