提交 e3b56388 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Flake8 + comments.

上级 2766871b
......@@ -404,7 +404,7 @@ class test_Eig(utt.InferShapeTester):
self.rng = numpy.random.RandomState(utt.fetch_seed())
self.A = theano.tensor.matrix(dtype=self.dtype)
self.X = numpy.asarray(self.rng.rand(5, 5),
dtype=self.dtype)
dtype=self.dtype)
self.S = self.X.dot(self.X.T)
def test_infer_shape(self):
......@@ -440,6 +440,8 @@ class test_Eigh(test_Eig):
def test_grad(self):
X = self.X
# We need to do the dot inside the graph because Eigh needs a
# matrix that is hermitian
utt.verify_grad(lambda x: self.op(x.dot(x.T))[0], [X], rng=self.rng)
utt.verify_grad(lambda x: self.op(x.dot(x.T))[1], [X], rng=self.rng)
utt.verify_grad(lambda x: self.op(x.dot(x.T), 'U')[0], [X], rng=self.rng)
......
......@@ -74,6 +74,9 @@ def test_cholesky_grad():
raise SkipTest("Scipy needed for the Cholesky op.")
rng = numpy.random.RandomState(utt.fetch_seed())
r = rng.randn(5, 5).astype(config.floatX)
# The dots are inside the graph since Cholesky needs separable matrices
# Check the default.
yield (lambda: utt.verify_grad(lambda r: cholesky(r.dot(r.T)),
[r], 3, rng))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论