Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c749cbc6
提交
c749cbc6
authored
8月 21, 2017
作者:
affanv14
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test optimization in grouped convolution
上级
b998dc61
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
14 行增加
和
74 行删除
+14
-74
test_dnn.py
theano/gpuarray/tests/test_dnn.py
+2
-12
test_gemmcorr.py
theano/gpuarray/tests/test_gemmcorr.py
+1
-6
test_gemmcorr3d.py
theano/gpuarray/tests/test_gemmcorr3d.py
+1
-6
test_abstract_conv.py
theano/tensor/nnet/tests/test_abstract_conv.py
+8
-34
test_corr.py
theano/tensor/nnet/tests/test_corr.py
+1
-9
test_corr3d.py
theano/tensor/nnet/tests/test_corr3d.py
+1
-7
没有找到文件。
theano/gpuarray/tests/test_dnn.py
浏览文件 @
c749cbc6
...
...
@@ -2288,27 +2288,17 @@ def dconvgi(border_mode, subsample, filter_dilation, num_groups):
class
Cudnn_grouped_conv
(
Grouped_conv_noOptim
):
mode
=
mode_with_gpu
conv
=
staticmethod
(
dconvfwd
)
conv_gradw
=
staticmethod
(
dconvgw
)
conv_gradi
=
staticmethod
(
dconvgi
)
mode
=
mode_with_gpu
.
excluding
(
'conv_gemm'
)
conv_op
=
dnn
.
GpuDnnConv
conv_gradw_op
=
dnn
.
GpuDnnConvGradW
conv_gradi_op
=
dnn
.
GpuDnnConvGradI
flip_filter
=
False
is_dnn
=
True
class
Cudnn_grouped_conv3d
(
Grouped_conv3d_noOptim
):
mode
=
mode_with_gpu
conv
=
staticmethod
(
dconvfwd
)
conv_gradw
=
staticmethod
(
dconvgw
)
conv_gradi
=
staticmethod
(
dconvgi
)
mode
=
mode_with_gpu
.
excluding
(
'conv_gemm'
)
conv_op
=
dnn
.
GpuDnnConv
conv_gradw_op
=
dnn
.
GpuDnnConvGradW
conv_gradi_op
=
dnn
.
GpuDnnConvGradI
flip_filter
=
False
is_dnn
=
True
def
test_dnn_spatialtf
():
...
...
theano/gpuarray/tests/test_gemmcorr.py
浏览文件 @
c749cbc6
...
...
@@ -223,12 +223,7 @@ class TestCorrMM(unittest.TestCase):
class
TestGroupGpuCorr2d
(
Grouped_conv_noOptim
):
mode
=
theano
.
compile
.
get_mode
(
"FAST_RUN"
)
conv
=
GpuCorrMM
conv_gradw
=
GpuCorrMM_gradWeights
conv_gradi
=
GpuCorrMM_gradInputs
mode
=
mode_with_gpu
.
excluding
(
'cudnn'
)
conv_op
=
GpuCorrMM
conv_gradw_op
=
GpuCorrMM_gradWeights
conv_gradi_op
=
GpuCorrMM_gradInputs
flip_filter
=
True
is_dnn
=
False
theano/gpuarray/tests/test_gemmcorr3d.py
浏览文件 @
c749cbc6
...
...
@@ -222,12 +222,7 @@ class TestCorr3dMM(unittest.TestCase):
class
TestGroupGpuCorr3d
(
Grouped_conv3d_noOptim
):
mode
=
theano
.
compile
.
get_mode
(
"FAST_RUN"
)
conv
=
GpuCorr3dMM
conv_gradw
=
GpuCorr3dMM_gradWeights
conv_gradi
=
GpuCorr3dMM_gradInputs
mode
=
mode_with_gpu
.
excluding
(
'cudnn'
)
conv_op
=
GpuCorr3dMM
conv_gradw_op
=
GpuCorr3dMM_gradWeights
conv_gradi_op
=
GpuCorr3dMM_gradInputs
flip_filter
=
True
is_dnn
=
False
theano/tensor/nnet/tests/test_abstract_conv.py
浏览文件 @
c749cbc6
...
...
@@ -1439,7 +1439,6 @@ class Grouped_conv_noOptim(unittest.TestCase):
conv_gradw_op
=
theano
.
tensor
.
nnet
.
abstract_conv
.
AbstractConv2d_gradWeights
conv_gradi_op
=
theano
.
tensor
.
nnet
.
abstract_conv
.
AbstractConv2d_gradInputs
mode
=
theano
.
Mode
(
optimizer
=
None
)
flip_filter
=
False
is_dnn
=
False
def
setUp
(
self
):
...
...
@@ -1476,13 +1475,7 @@ class Grouped_conv_noOptim(unittest.TestCase):
subsample
=
self
.
subsample
,
filter_dilation
=
self
.
filter_dilation
,
num_groups
=
groups
)
if
self
.
flip_filter
:
if
self
.
convdim
==
2
:
grouped_conv_output
=
grouped_conv_op
(
img_sym
,
kern_sym
[:,
:,
::
-
1
,
::
-
1
])
else
:
grouped_conv_output
=
grouped_conv_op
(
img_sym
,
kern_sym
[:,
:,
::
-
1
,
::
-
1
,
::
-
1
])
else
:
grouped_conv_output
=
grouped_conv_op
(
img_sym
,
kern_sym
)
grouped_conv_output
=
grouped_conv_op
(
img_sym
,
kern_sym
)
grouped_func
=
theano
.
function
([
img_sym
,
kern_sym
],
grouped_conv_output
,
mode
=
self
.
mode
)
assert
any
([
isinstance
(
node
.
op
,
self
.
conv_op
)
...
...
@@ -1527,13 +1520,7 @@ class Grouped_conv_noOptim(unittest.TestCase):
grouped_conv_output
=
grouped_convgrad_op
(
img_sym
,
top_sym
,
tensor
.
as_tensor_variable
(
kshp
if
self
.
is_dnn
else
kshp
[
-
self
.
convdim
:]))
if
self
.
flip_filter
:
if
self
.
convdim
==
2
:
grouped_conv_output
=
grouped_conv_output
[:,
:,
::
-
1
,
::
-
1
]
else
:
grouped_conv_output
=
grouped_conv_output
[:,
:,
::
-
1
,
::
-
1
,
::
-
1
]
kshp
[
-
self
.
convdim
:]))
grouped_func
=
theano
.
function
([
img_sym
,
top_sym
],
grouped_conv_output
,
mode
=
self
.
mode
)
assert
any
([
isinstance
(
node
.
op
,
self
.
conv_gradw_op
)
for
node
in
grouped_func
.
maker
.
fgraph
.
toposort
()])
...
...
@@ -1556,8 +1543,7 @@ class Grouped_conv_noOptim(unittest.TestCase):
def
conv_gradweight
(
inputs_val
,
output_val
):
return
grouped_convgrad_op
(
inputs_val
,
output_val
,
tensor
.
as_tensor_variable
(
kshp
if
self
.
is_dnn
else
kshp
[
-
self
.
convdim
:]))
kshp
[
-
self
.
convdim
:]))
utt
.
verify_grad
(
conv_gradweight
,
[
img
,
top
],
...
...
@@ -1580,19 +1566,10 @@ class Grouped_conv_noOptim(unittest.TestCase):
subsample
=
self
.
subsample
,
filter_dilation
=
self
.
filter_dilation
,
num_groups
=
groups
)
if
self
.
flip_filter
:
if
self
.
convdim
==
2
:
grouped_conv_output
=
grouped_convgrad_op
(
kern_sym
[:,
:,
::
-
1
,
::
-
1
],
top_sym
,
tensor
.
as_tensor_variable
(
imshp
[
-
self
.
convdim
:]))
else
:
grouped_conv_output
=
grouped_convgrad_op
(
kern_sym
[:,
:,
::
-
1
,
::
-
1
,
::
-
1
],
top_sym
,
tensor
.
as_tensor_variable
(
imshp
[
-
self
.
convdim
:]))
else
:
grouped_conv_output
=
grouped_convgrad_op
(
kern_sym
,
top_sym
,
tensor
.
as_tensor_variable
(
imshp
if
self
.
is_dnn
else
imshp
[
-
self
.
convdim
:]))
grouped_conv_output
=
grouped_convgrad_op
(
kern_sym
,
top_sym
,
tensor
.
as_tensor_variable
(
imshp
[
-
self
.
convdim
:]))
grouped_func
=
theano
.
function
([
kern_sym
,
top_sym
],
grouped_conv_output
,
mode
=
self
.
mode
)
assert
any
([
isinstance
(
node
.
op
,
self
.
conv_gradi_op
)
for
node
in
grouped_func
.
maker
.
fgraph
.
toposort
()])
...
...
@@ -1615,8 +1592,7 @@ class Grouped_conv_noOptim(unittest.TestCase):
def
conv_gradinputs
(
filters_val
,
output_val
):
return
grouped_convgrad_op
(
filters_val
,
output_val
,
tensor
.
as_tensor_variable
(
imshp
if
self
.
is_dnn
else
imshp
[
-
self
.
convdim
:]))
imshp
[
-
self
.
convdim
:]))
utt
.
verify_grad
(
conv_gradinputs
,
[
kern
,
top
],
...
...
@@ -1631,8 +1607,6 @@ class Grouped_conv3d_noOptim(Grouped_conv_noOptim):
conv_gradw_op
=
theano
.
tensor
.
nnet
.
abstract_conv
.
AbstractConv3d_gradWeights
conv_gradi_op
=
theano
.
tensor
.
nnet
.
abstract_conv
.
AbstractConv3d_gradInputs
mode
=
theano
.
Mode
(
optimizer
=
None
)
flip_filter
=
False
is_dnn
=
False
def
setUp
(
self
):
self
.
num_groups
=
[
3
,
2
,
4
,
4
]
...
...
theano/tensor/nnet/tests/test_corr.py
浏览文件 @
c749cbc6
...
...
@@ -418,18 +418,10 @@ class TestCorr2D(utt.InferShapeTester):
class
TestGroupCorr2d
(
Grouped_conv_noOptim
):
if
theano
.
config
.
mode
==
"FAST_COMPILE"
:
mode
=
theano
.
compile
.
get_mode
(
"FAST_RUN"
)
else
:
mode
=
None
conv
=
corr
.
CorrMM
conv_gradw
=
corr
.
CorrMM_gradWeights
conv_gradi
=
corr
.
CorrMM_gradInputs
mode
=
theano
.
compile
.
get_mode
(
"FAST_RUN"
)
.
excluding
(
'gpuarray'
)
conv_op
=
corr
.
CorrMM
conv_gradw_op
=
corr
.
CorrMM_gradWeights
conv_gradi_op
=
corr
.
CorrMM_gradInputs
flip_filter
=
True
is_dnn
=
False
def
test_graph
(
self
):
# define common values first
...
...
theano/tensor/nnet/tests/test_corr3d.py
浏览文件 @
c749cbc6
...
...
@@ -420,13 +420,7 @@ class TestCorr3D(utt.InferShapeTester):
class
TestGroupCorr3d
(
Grouped_conv3d_noOptim
):
if
theano
.
config
.
mode
==
"FAST_COMPILE"
:
mode
=
theano
.
compile
.
get_mode
(
"FAST_RUN"
)
else
:
mode
=
None
conv
=
corr3d
.
Corr3dMM
conv_gradw
=
corr3d
.
Corr3dMM_gradWeights
conv_gradi
=
corr3d
.
Corr3dMM_gradInputs
mode
=
theano
.
compile
.
get_mode
(
"FAST_RUN"
)
conv_op
=
corr3d
.
Corr3dMM
conv_gradw_op
=
corr3d
.
Corr3dMM_gradWeights
conv_gradi_op
=
corr3d
.
Corr3dMM_gradInputs
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论