diff simple_autoassociator.py/graph.py @ 388:98ca97cc9910

Debugging simple AA
author Joseph Turian <turian@gmail.com>
date Tue, 08 Jul 2008 17:41:26 -0400
parents a474341861fa
children
line wrap: on
line diff
--- a/simple_autoassociator.py/graph.py	Tue Jul 08 17:08:23 2008 -0400
+++ b/simple_autoassociator.py/graph.py	Tue Jul 08 17:41:26 2008 -0400
@@ -14,12 +14,13 @@
 h           = sigmoid(dot(x, w1) + b1)
 y           = sigmoid(dot(h, w2) + b2)
 
-loss = t.sum(binary_crossentropy(y, x))
+loss_unsummed = binary_crossentropy(y, x)
+loss = t.sum(loss_unsummed)
 
 (gw1, gb1, gw2, gb2) = t.grad(loss, [w1, b1, w2, b2])
 
 import theano.compile
 
 inputs  = [x, w1, b1, w2, b2]
-outputs = [y, loss, gw1, gb1, gw2, gb2]
+outputs = [y, h, loss, loss_unsummed, gw1, gb1, gw2, gb2]
 trainfn = theano.compile.function(inputs, outputs)