Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
b320ab29
提交
b320ab29
authored
1月 08, 2015
作者:
abergeron
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2380 from nouiz/tests
Fix tests
上级
9eea2234
e28ce73e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
15 行增加
和
10 行删除
+15
-10
test_mlp.py
theano/sandbox/cuda/tests/test_mlp.py
+3
-1
rng_mrg.py
theano/sandbox/rng_mrg.py
+2
-2
test_slinalg.py
theano/tensor/tests/test_slinalg.py
+10
-7
没有找到文件。
theano/sandbox/cuda/tests/test_mlp.py
浏览文件 @
b320ab29
...
@@ -397,7 +397,9 @@ def build_conv_nnet2_classif(use_gpu, isize, ksize, n_batch,
...
@@ -397,7 +397,9 @@ def build_conv_nnet2_classif(use_gpu, isize, ksize, n_batch,
# Check that GpuConv is used
# Check that GpuConv is used
topo
=
train
.
maker
.
fgraph
.
toposort
()
topo
=
train
.
maker
.
fgraph
.
toposort
()
conv_ops
=
(
tcn
.
blas
.
GpuConv
,
conv_ops
=
(
tcn
.
blas
.
GpuConv
,
tcn
.
dnn
.
GpuDnnConvBase
,
tcn
.
dnn
.
GpuDnnConv
,
tcn
.
dnn
.
GpuDnnConvGradI
,
tcn
.
dnn
.
GpuDnnConvGradW
,
tcn
.
blas
.
BaseGpuCorrMM
)
tcn
.
blas
.
BaseGpuCorrMM
)
assert
len
([
n
for
n
in
topo
if
isinstance
(
n
.
op
,
conv_ops
)])
>
0
assert
len
([
n
for
n
in
topo
if
isinstance
(
n
.
op
,
conv_ops
)])
>
0
...
...
theano/sandbox/rng_mrg.py
浏览文件 @
b320ab29
...
@@ -1007,7 +1007,7 @@ class GPUA_mrg_uniform(GpuKernelBase, mrg_uniform_base):
...
@@ -1007,7 +1007,7 @@ class GPUA_mrg_uniform(GpuKernelBase, mrg_uniform_base):
return
(
3
,
self
.
GpuKernelBase_version
)
return
(
3
,
self
.
GpuKernelBase_version
)
def
guess_n_streams
(
size
,
warn
=
Tru
e
):
def
guess_n_streams
(
size
,
warn
=
Fals
e
):
"""
"""
Return a guess at a good number of streams.
Return a guess at a good number of streams.
...
@@ -1128,7 +1128,7 @@ class MRG_RandomStreams(object):
...
@@ -1128,7 +1128,7 @@ class MRG_RandomStreams(object):
return
rval
return
rval
def
n_streams
(
self
,
size
):
def
n_streams
(
self
,
size
):
return
guess_n_streams
(
size
,
warn
=
True
)
return
guess_n_streams
(
size
)
def
pretty_return
(
self
,
node_rstate
,
new_rstate
,
sample
):
def
pretty_return
(
self
,
node_rstate
,
new_rstate
,
sample
):
sample
.
rstate
=
node_rstate
sample
.
rstate
=
node_rstate
...
...
theano/tensor/tests/test_slinalg.py
浏览文件 @
b320ab29
...
@@ -251,10 +251,11 @@ def test_expm_grad_1():
...
@@ -251,10 +251,11 @@ def test_expm_grad_1():
if
not
imported_scipy
:
if
not
imported_scipy
:
raise
SkipTest
(
"Scipy needed for the expm op."
)
raise
SkipTest
(
"Scipy needed for the expm op."
)
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
())
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
())
A
=
rng
.
randn
(
5
,
5
)
.
astype
(
config
.
floatX
)
# Always test in float64 for better numerical stability.
A
=
rng
.
randn
(
5
,
5
)
A
=
A
+
A
.
T
A
=
A
+
A
.
T
tensor
.
verify_grad
(
expm
,
[
A
,
],
rng
=
rng
)
tensor
.
verify_grad
(
expm
,
[
A
],
rng
=
rng
)
def
test_expm_grad_2
():
def
test_expm_grad_2
():
...
@@ -262,12 +263,13 @@ def test_expm_grad_2():
...
@@ -262,12 +263,13 @@ def test_expm_grad_2():
if
not
imported_scipy
:
if
not
imported_scipy
:
raise
SkipTest
(
"Scipy needed for the expm op."
)
raise
SkipTest
(
"Scipy needed for the expm op."
)
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
())
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
())
A
=
rng
.
randn
(
5
,
5
)
.
astype
(
config
.
floatX
)
# Always test in float64 for better numerical stability.
w
=
(
rng
.
randn
(
5
)
.
astype
(
config
.
floatX
))
**
2
A
=
rng
.
randn
(
5
,
5
)
w
=
rng
.
randn
(
5
)
**
2
A
=
(
numpy
.
diag
(
w
**
0.5
))
.
dot
(
A
+
A
.
T
)
.
dot
(
numpy
.
diag
(
w
**
(
-
0.5
)))
A
=
(
numpy
.
diag
(
w
**
0.5
))
.
dot
(
A
+
A
.
T
)
.
dot
(
numpy
.
diag
(
w
**
(
-
0.5
)))
assert
not
numpy
.
allclose
(
A
,
A
.
T
)
assert
not
numpy
.
allclose
(
A
,
A
.
T
)
tensor
.
verify_grad
(
expm
,
[
A
,
],
rng
=
rng
)
tensor
.
verify_grad
(
expm
,
[
A
],
rng
=
rng
)
def
test_expm_grad_3
():
def
test_expm_grad_3
():
...
@@ -275,6 +277,7 @@ def test_expm_grad_3():
...
@@ -275,6 +277,7 @@ def test_expm_grad_3():
if
not
imported_scipy
:
if
not
imported_scipy
:
raise
SkipTest
(
"Scipy needed for the expm op."
)
raise
SkipTest
(
"Scipy needed for the expm op."
)
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
())
rng
=
numpy
.
random
.
RandomState
(
utt
.
fetch_seed
())
A
=
rng
.
randn
(
5
,
5
)
.
astype
(
config
.
floatX
)
# Always test in float64 for better numerical stability.
A
=
rng
.
randn
(
5
,
5
)
tensor
.
verify_grad
(
expm
,
[
A
,
],
rng
=
rng
)
tensor
.
verify_grad
(
expm
,
[
A
],
rng
=
rng
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论