提交 4d85e16d authored 作者: Razvan Pascanu's avatar Razvan Pascanu

added names to scans

This will help during debugging
上级 3a4bdbbd
...@@ -2154,19 +2154,23 @@ class T_Scan(unittest.TestCase): ...@@ -2154,19 +2154,23 @@ class T_Scan(unittest.TestCase):
n2o_u,_ = theano.scan( lambda i, o,u,h0,W,eu: n2o_u,_ = theano.scan( lambda i, o,u,h0,W,eu:
(theano.tensor.grad(o[i], u)*eu).sum(), (theano.tensor.grad(o[i], u)*eu).sum(),
sequences = tensor.arange(o.shape[0]), sequences = tensor.arange(o.shape[0]),
non_sequences = [o,u,h0,W,eu]) non_sequences = [o,u,h0,W,eu],
name = 'jacobU'
)
n2o_h0,_ = theano.scan( lambda i, o,u,h0,W,eh0: n2o_h0,_ = theano.scan( lambda i, o,u,h0,W,eh0:
(theano.tensor.grad(o[i], h0)*eh0).sum(), (theano.tensor.grad(o[i], h0)*eh0).sum(),
sequences = tensor.arange(o.shape[0]), sequences = tensor.arange(o.shape[0]),
non_sequences = [o,u,h0,W,eh0]) non_sequences = [o,u,h0,W,eh0],
name = 'jacobh')
n2o_W,_ = theano.scan( lambda i, o,u,h0,W,eW: n2o_W,_ = theano.scan( lambda i, o,u,h0,W,eW:
(theano.tensor.grad(o[i], W)*eW).sum(), (theano.tensor.grad(o[i], W)*eW).sum(),
sequences = tensor.arange(o.shape[0]), sequences = tensor.arange(o.shape[0]),
non_sequences = [o,u,h0,W,eW]) non_sequences = [o,u,h0,W,eW],
name = 'jacobW')
fn_test = theano.function([u,h0,W,eu,eh0,eW], fn_test = theano.function([u,h0,W,eu,eh0,eW],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论