Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
da05aee0
提交
da05aee0
authored
6月 02, 2009
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
better printing of the info about timming.
上级
9e152f02
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
18 行增加
和
20 行删除
+18
-20
test_conv.py
theano/sandbox/test_conv.py
+18
-20
没有找到文件。
theano/sandbox/test_conv.py
浏览文件 @
da05aee0
...
...
@@ -326,15 +326,18 @@ class TestConvOp(unittest.TestCase):
return
tctot
,
tpytot
,
ntot
if
Tru
e
:
if
Fals
e
:
# calculate the speed up of different combination of unroll
# we don't validate the result to have it much faster!
validate
=
False
# put the paramter to the same you will try.
validate
=
False
# we don't validate the result to have it much faster!
unroll_batch
=
[
0
,
1
,
2
,
5
,
10
]
unroll_batch
=
[
0
,
1
,
2
,
5
,
10
,
20
]
unroll_kern
=
[
0
,
1
,
2
,
5
,
10
,
20
]
# unroll_batch = [0,2,5]
# unroll_kern = [0,2,5]
bsize
=
1
0
# batch size
bsize
=
2
0
# batch size
imshp_start
=
(
1
,
50
,
49
)
#un square shape to test more corner case.
kshps
=
([
11
,
12
],[
12
,
11
])
#un square shape to test more corner case.
nkerns
=
[
20
,
20
]
# per output pixel
...
...
@@ -343,10 +346,10 @@ class TestConvOp(unittest.TestCase):
do_theano
=
False
timing
=
N
.
zeros
((
len
(
unroll_batch
),
len
(
unroll_kern
),
3
))
t_b_k
=
[]
for
unroll_b
,
n_b
in
zip
(
unroll_batch
,
range
(
len
(
unroll_batch
))):
for
unroll_k
,
n_k
in
zip
(
unroll_kern
,
range
(
len
(
unroll_kern
))):
t_b_k
+=
[
str
(
unroll_b
)
+
"/"
+
str
(
unroll_k
)]
tctot
,
tpytot
,
ntot
=
[],[],[]
for
conv_mode
,
n_mode
in
zip
(
convmodes
,
range
(
len
(
convmodes
))):
for
ss
,
n_ss
in
zip
(
ssizes
,
range
(
len
(
ssizes
))):
...
...
@@ -355,20 +358,15 @@ class TestConvOp(unittest.TestCase):
tpytot
+=
[
tpytot_
]
ntot
+=
[
ntot_
]
timing
[
n_b
,
n_k
]
=
[
sum
(
tctot
),
sum
(
tpytot
),
sum
(
ntot
)]
print
'**** Multilayer Convolution Profiling Results ****'
print
'unroll batch'
,
unroll_b
,
'unroll kern'
,
unroll_k
print
'Numpy convolve2d processing time:
%.3
fs'
%
sum
(
ntot
),
ntot
print
'c Theano(ConvOp) processing time:
%.3
fs'
%
sum
(
tctot
),
tctot
print
'py Theano(ConvOp) processing time:
%.3
fs'
%
sum
(
tpytot
),
tpytot
d
=
N
.
asarray
(
ntot
)
/
tctot
print
'speed up c theano(ConvOp) vs convolve2d:
%.3
f'
%
d
.
mean
(),
d
print
timing
t
=
timing
[:,:,
0
]
for
b
in
unroll_batch
:
for
k
in
unroll_kern
:
print
b
,
"/"
,
k
,
" "
,
# print timing
t
=
timing
[:,:,
0
]
#We select only the c timing.
print
t_b_k
print
t
print
"min"
,
t
.
min
(),
"max"
,
t
.
max
(),
"speedup"
,
t
.
max
()
/
t
.
min
()
print
"max
%.3
fs"
%
t
.
max
(),
"max param(batch unloop size/kernel unloop size)"
,
t_b_k
[
t
.
argmax
()]
print
"min
%.3
fs"
%
t
.
min
(),
"min param(batch unloop size/kernel unloop size)"
,
t_b_k
[
t
.
argmin
()]
print
"speedup
%.3
fx"
%
t
.
max
()
/
t
.
min
()
return
for
conv_mode
,
n_mode
in
zip
(
convmodes
,
range
(
len
(
convmodes
))):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论