Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
1d8ef85d
提交
1d8ef85d
authored
10月 24, 2011
作者:
Razvan Pascanu
提交者:
David Warde-Farley
10月 24, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use utt.get_seed() to give a seed for every random generator.
Conflicts: theano/sandbox/linalg/tests/test_linalg.py
上级
1a0d4a49
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
4 行删除
+6
-4
test_linalg.py
theano/sandbox/linalg/tests/test_linalg.py
+6
-4
没有找到文件。
theano/sandbox/linalg/tests/test_linalg.py
浏览文件 @
1d8ef85d
...
@@ -38,7 +38,7 @@ if 0:
...
@@ -38,7 +38,7 @@ if 0:
def
test_cholesky
():
def
test_cholesky
():
#TODO: test upper and lower triangular
#TODO: test upper and lower triangular
#todo: unittest randomseed
#todo: unittest randomseed
rng
=
numpy
.
random
.
RandomState
(
1234
)
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
()
)
r
=
rng
.
randn
(
5
,
5
)
r
=
rng
.
randn
(
5
,
5
)
...
@@ -60,8 +60,7 @@ if 0:
...
@@ -60,8 +60,7 @@ if 0:
def
test_inverse_correctness
():
def
test_inverse_correctness
():
#todo: unittest randomseed
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
())
rng
=
numpy
.
random
.
RandomState
(
12345
)
r
=
rng
.
randn
(
4
,
4
)
.
astype
(
theano
.
config
.
floatX
)
r
=
rng
.
randn
(
4
,
4
)
.
astype
(
theano
.
config
.
floatX
)
...
@@ -79,6 +78,9 @@ def test_inverse_correctness():
...
@@ -79,6 +78,9 @@ def test_inverse_correctness():
assert
_allclose
(
numpy
.
identity
(
4
),
rri
),
rri
assert
_allclose
(
numpy
.
identity
(
4
),
rri
),
rri
def
test_inverse_grad
():
def
test_inverse_grad
():
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
())
r
=
rng
.
randn
(
4
,
4
)
tensor
.
verify_grad
(
matrix_inverse
,
[
r
],
rng
=
numpy
.
random
)
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
())
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
())
...
@@ -136,7 +138,7 @@ def test_det_grad():
...
@@ -136,7 +138,7 @@ def test_det_grad():
# If scipy is not available, this test will fail, thus we skip it.
# If scipy is not available, this test will fail, thus we skip it.
if
not
use_scipy
:
if
not
use_scipy
:
raise
SkipTest
(
'Scipy is not available'
)
raise
SkipTest
(
'Scipy is not available'
)
rng
=
numpy
.
random
.
RandomState
(
1234
)
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
()
)
r
=
rng
.
randn
(
5
,
5
)
r
=
rng
.
randn
(
5
,
5
)
tensor
.
verify_grad
(
det
,
[
r
],
rng
=
numpy
.
random
)
tensor
.
verify_grad
(
det
,
[
r
],
rng
=
numpy
.
random
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论