Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
9baed894
提交
9baed894
authored
10月 19, 2015
作者:
Nicolas Ballas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updates
上级
9367e589
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
4 行删除
+12
-4
test_abstractconv.py
theano/sandbox/cuda/tests/test_abstractconv.py
+0
-2
abstract_conv2d.py
theano/tensor/nnet/abstract_conv2d.py
+12
-2
没有找到文件。
theano/sandbox/cuda/tests/test_abstractconv.py
浏览文件 @
9baed894
...
@@ -14,7 +14,6 @@ import theano.sandbox.cuda as cuda
...
@@ -14,7 +14,6 @@ import theano.sandbox.cuda as cuda
if
not
cuda
.
cuda_available
:
if
not
cuda
.
cuda_available
:
raise
SkipTest
(
'Optional package cuda disabled'
)
raise
SkipTest
(
'Optional package cuda disabled'
)
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
mode_with_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
including
(
'gpu'
)
mode_with_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
including
(
'gpu'
)
mode_without_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
excluding
(
'gpu'
)
mode_without_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
excluding
(
'gpu'
)
...
@@ -37,7 +36,6 @@ class TestConv2d(unittest.TestCase):
...
@@ -37,7 +36,6 @@ class TestConv2d(unittest.TestCase):
self
.
filter_flip
=
[
True
,
False
]
self
.
filter_flip
=
[
True
,
False
]
def
get_output_shape
(
self
,
inputs_shape
,
filters_shape
,
subsample
,
border_mode
):
def
get_output_shape
(
self
,
inputs_shape
,
filters_shape
,
subsample
,
border_mode
):
if
border_mode
==
"valid"
:
if
border_mode
==
"valid"
:
border_mode
=
(
0
,
0
)
border_mode
=
(
0
,
0
)
if
border_mode
==
"full"
:
if
border_mode
==
"full"
:
...
...
theano/tensor/nnet/abstract_conv2d.py
浏览文件 @
9baed894
"""
"""
Define abstract conv2d interface
Define abstract conv2d interface
"""
"""
__docformat__
=
"restructuredtext en"
import
logging
import
logging
import
theano
import
theano
from
theano.tensor
import
as_tensor_variable
from
theano.tensor
import
(
as_tensor_variable
,
patternbroadcast
)
from
theano.tensor
import
TensorType
from
theano.gof
import
Apply
,
Op
from
theano.gof
import
Apply
,
Op
from
theano.gof
import
local_optimizer
from
theano.tensor.opt
import
register_specialize_device
__docformat__
=
"restructuredtext en"
_logger
=
logging
.
getLogger
(
"theano.tensor.nnet.conv2d"
)
_logger
=
logging
.
getLogger
(
"theano.tensor.nnet.conv2d"
)
...
@@ -168,6 +174,7 @@ def conv2d(input,
...
@@ -168,6 +174,7 @@ def conv2d(input,
return
conv_op
(
input
,
filters
)
return
conv_op
(
input
,
filters
)
class
BaseAbstractConv2d
(
Op
):
class
BaseAbstractConv2d
(
Op
):
"""
"""
Base class for AbstractConv
Base class for AbstractConv
...
@@ -187,6 +194,7 @@ class BaseAbstractConv2d(Op):
...
@@ -187,6 +194,7 @@ class BaseAbstractConv2d(Op):
element is not known at compile time.
element is not known at compile time.
kshp is defined w.r.t the forward conv.
kshp is defined w.r.t the forward conv.
:type border_mode: str, int or tuple of two int
:type border_mode: str, int or tuple of two int
:param border_mode: Either of the following:
:param border_mode: Either of the following:
* ``'valid'``: apply filter wherever it completely overlaps with the
* ``'valid'``: apply filter wherever it completely overlaps with the
...
@@ -219,6 +227,7 @@ class BaseAbstractConv2d(Op):
...
@@ -219,6 +227,7 @@ class BaseAbstractConv2d(Op):
imshp
=
None
,
kshp
=
None
,
imshp
=
None
,
kshp
=
None
,
border_mode
=
"valid"
,
subsample
=
(
1
,
1
),
border_mode
=
"valid"
,
subsample
=
(
1
,
1
),
filter_flip
=
True
):
filter_flip
=
True
):
if
isinstance
(
border_mode
,
int
):
if
isinstance
(
border_mode
,
int
):
border_mode
=
(
border_mode
,
border_mode
)
border_mode
=
(
border_mode
,
border_mode
)
if
isinstance
(
border_mode
,
tuple
):
if
isinstance
(
border_mode
,
tuple
):
...
@@ -297,6 +306,7 @@ class AbstractConv2d(BaseAbstractConv2d):
...
@@ -297,6 +306,7 @@ class AbstractConv2d(BaseAbstractConv2d):
self
.
border_mode
,
self
.
border_mode
,
self
.
subsample
,
self
.
subsample
,
self
.
filter_flip
)(
self
.
filter_flip
)(
bottom
,
top
,
weights
.
shape
[
-
2
:])
bottom
,
top
,
weights
.
shape
[
-
2
:])
return
d_bottom
,
d_weights
return
d_bottom
,
d_weights
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论