comparison simple_autoassociator/graph.py @ 392:e2cb8d489908

More debugging
author Joseph Turian <turian@gmail.com>
date Tue, 08 Jul 2008 18:45:35 -0400
parents ec8aadb6694d
children
comparison
equal deleted inserted replaced
389:ec8aadb6694d 392:e2cb8d489908
15 y = sigmoid(dot(h, w2) + b2) 15 y = sigmoid(dot(h, w2) + b2)
16 16
17 loss_unsummed = binary_crossentropy(y, x) 17 loss_unsummed = binary_crossentropy(y, x)
18 loss = t.sum(loss_unsummed) 18 loss = t.sum(loss_unsummed)
19 19
20 (gw1, gb1, gw2, gb2) = t.grad(loss, [w1, b1, w2, b2]) 20 (gw1, gb1, gw2, gb2, gy) = t.grad(loss, [w1, b1, w2, b2, y])
21 21
22 import theano.compile 22 import theano.compile
23 23
24 inputs = [x, w1, b1, w2, b2] 24 inputs = [x, w1, b1, w2, b2]
25 outputs = [y, h, loss, loss_unsummed, gw1, gb1, gw2, gb2] 25 outputs = [y, h, loss, loss_unsummed, gw1, gb1, gw2, gb2, gy]
26 trainfn = theano.compile.function(inputs, outputs) 26 trainfn = theano.compile.function(inputs, outputs)