提交 e945851a authored 作者: Frederic's avatar Frederic

pep8

上级 9a44f9bf
...@@ -1137,6 +1137,7 @@ class T_graphstructures(unittest.TestCase): ...@@ -1137,6 +1137,7 @@ class T_graphstructures(unittest.TestCase):
assert e.owner.inputs[1].owner.inputs[0] is y assert e.owner.inputs[1].owner.inputs[0] is y
assert e.owner.inputs[1].owner.inputs[1] is z assert e.owner.inputs[1].owner.inputs[1] is z
class T_scan(unittest.TestCase): class T_scan(unittest.TestCase):
## All tests here belong to ## All tests here belong to
## http://deeplearning.net/software/theano/tutorial/loop.html ## http://deeplearning.net/software/theano/tutorial/loop.html
...@@ -1144,7 +1145,6 @@ class T_scan(unittest.TestCase): ...@@ -1144,7 +1145,6 @@ class T_scan(unittest.TestCase):
## Any change you do here also add it to the tutorial ! ## Any change you do here also add it to the tutorial !
def test_elemwise(self): def test_elemwise(self):
# defining the tensor variables # defining the tensor variables
X = T.matrix("X") X = T.matrix("X")
W = T.matrix("W") W = T.matrix("W")
...@@ -1167,7 +1167,6 @@ class T_scan(unittest.TestCase): ...@@ -1167,7 +1167,6 @@ class T_scan(unittest.TestCase):
print "Numpy results:", numpy.tanh(x.dot(w) + b) print "Numpy results:", numpy.tanh(x.dot(w) + b)
def test_sequence(self): def test_sequence(self):
# define tensor variables # define tensor variables
X = T.vector("X") X = T.vector("X")
W = T.matrix("W") W = T.matrix("W")
...@@ -1228,7 +1227,6 @@ class T_scan(unittest.TestCase): ...@@ -1228,7 +1227,6 @@ class T_scan(unittest.TestCase):
numpy.sqrt((x**2).sum(0)) numpy.sqrt((x**2).sum(0))
def test_trace(self): def test_trace(self):
# define tensor variable # define tensor variable
X = T.matrix("X") X = T.matrix("X")
results, updates = theano.scan(lambda i, j, t_f:T.cast(X[i,j] + \ results, updates = theano.scan(lambda i, j, t_f:T.cast(X[i,j] + \
...@@ -1250,7 +1248,6 @@ class T_scan(unittest.TestCase): ...@@ -1250,7 +1248,6 @@ class T_scan(unittest.TestCase):
print "Numpy results:", numpy.diagonal(x).sum() print "Numpy results:", numpy.diagonal(x).sum()
def test_taps(self): def test_taps(self):
# define tensor variables # define tensor variables
X = T.matrix("X") X = T.matrix("X")
W = T.matrix("W") W = T.matrix("W")
...@@ -1293,7 +1290,6 @@ class T_scan(unittest.TestCase): ...@@ -1293,7 +1290,6 @@ class T_scan(unittest.TestCase):
print "Numpy results:", x_res print "Numpy results:", x_res
def test_jacobian(self): def test_jacobian(self):
# define tensor variables # define tensor variables
v = T.vector() v = T.vector()
A = T.matrix() A = T.matrix()
...@@ -1318,7 +1314,7 @@ class T_scan(unittest.TestCase): ...@@ -1318,7 +1314,7 @@ class T_scan(unittest.TestCase):
n_sym = T.iscalar("n_sym") n_sym = T.iscalar("n_sym")
results, updates = theano.scan(lambda:{k:(k+1)}, n_steps=n_sym) results, updates = theano.scan(lambda:{k:(k+1)}, n_steps=n_sym)
accumulator = theano.function([n_sym], [], updates=updates, \ accumulator = theano.function([n_sym], [], updates=updates,
allow_input_downcast = True) allow_input_downcast = True)
print "Before 5 steps:", k.get_value() print "Before 5 steps:", k.get_value()
...@@ -1346,4 +1342,3 @@ class T_scan(unittest.TestCase): ...@@ -1346,4 +1342,3 @@ class T_scan(unittest.TestCase):
b = numpy.ones((2)) b = numpy.ones((2))
print compute_with_bnoise(x, w, b) print compute_with_bnoise(x, w, b)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论