Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4cf06d2b
提交
4cf06d2b
authored
5月 23, 2014
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a mention of conv2d_fft in the docs and write a better docstring for it.
上级
d1f66a2f
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
24 行增加
和
10 行删除
+24
-10
conv.txt
doc/library/tensor/nnet/conv.txt
+6
-0
fftconv.py
theano/sandbox/cuda/fftconv.py
+18
-10
没有找到文件。
doc/library/tensor/nnet/conv.txt
浏览文件 @
4cf06d2b
...
@@ -27,6 +27,12 @@ TODO: Give examples for how to use these things! They are pretty complicated.
...
@@ -27,6 +27,12 @@ TODO: Give examples for how to use these things! They are pretty complicated.
- Conv implemented
- Conv implemented
- :func:`signal.conv2d <theano.tensor.signal.conv.conv2d>`.
- :func:`signal.conv2d <theano.tensor.signal.conv.conv2d>`.
- :func:`nnet.conv2d <theano.tensor.nnet.conv.conv2d>`.
- :func:`nnet.conv2d <theano.tensor.nnet.conv.conv2d>`.
- :func:`conv2d_fft <theano.sandbox.cuda.fftconv.conv2d_fft>`
This is a GPU-only version of conv2d that uses an FFT transform
to perform the work. You can enable it by setting
'THEANO_FLAGS=optimizer_including=conv_fft_valid:conv_fft_full'
in your environement. This is not enabled by default because it
has some restrictions on input and uses more memory.
- :func:`conv3D <theano.tensor.nnet.Conv3D.conv3D>`. Doesn't work on the GPU.
- :func:`conv3D <theano.tensor.nnet.Conv3D.conv3D>`. Doesn't work on the GPU.
- :func:`conv3d2d <theano.tensor.nnet.conv3d2d.conv3d>`
- :func:`conv3d2d <theano.tensor.nnet.conv3d2d.conv3d>`
Another conv3d implementation that uses the conv2d with data reshaping.
Another conv3d implementation that uses the conv2d with data reshaping.
...
...
theano/sandbox/cuda/fftconv.py
浏览文件 @
4cf06d2b
...
@@ -372,21 +372,29 @@ def mult_and_reduce(input_fft_v, filters_fft_v, input_shape=None,
...
@@ -372,21 +372,29 @@ def mult_and_reduce(input_fft_v, filters_fft_v, input_shape=None,
def
conv2d_fft
(
input
,
filters
,
image_shape
=
None
,
filter_shape
=
None
,
def
conv2d_fft
(
input
,
filters
,
image_shape
=
None
,
filter_shape
=
None
,
border_mode
=
'valid'
,
pad_last_dim
=
False
):
border_mode
=
'valid'
,
pad_last_dim
=
False
):
"""
"""
expects bc01 input
Perform a convolution through fft.
performs a valid/full convolution
Only support input which will be even on the last dimension
(width). All other dimensions can be anything and the filters can
have an even or odd width.
If you must use input which has an odd width, you can either pad
it or use the `pad_last_dim` argument which will do it for you and
take care to strip the padding before returning. Don't use this
argument if you are not sure the input is odd since the padding is
unconditional and will make even input odd, thus leading to
problems.
On valid mode the filters must be smaller than the input.
input: (b, ic, i0, i1)
input: (b, ic, i0, i1)
filters: (oc, ic, f0, f1)
filters: (oc, ic, f0, f1)
border_mode: 'valid' of 'full'
border_mode: 'valid' of 'full'
pad_last_dim: This code does not support
pad_last_dim: Unconditionally pad the last dimension of the input
images for which the last dimension (the "width") is odd. To support
to to turn it from odd to even. Will strip the
this, you can either pad your images on your own, or call this function
padding before returning the result.
with the `pad_last_dim` flag set to `True`.
This introduces an extra copying step and consumes memory.
The return value will still be of the appropriate shape because
the padding is trimmed right before the output is returned.
"""
"""
# use symbolic shapes to compute shape info at runtime if not specified
# use symbolic shapes to compute shape info at runtime if not specified
...
@@ -434,7 +442,7 @@ def conv2d_fft(input, filters, image_shape=None, filter_shape=None,
...
@@ -434,7 +442,7 @@ def conv2d_fft(input, filters, image_shape=None, filter_shape=None,
# them on one pixel. The top-left pixel of the images
# them on one pixel. The top-left pixel of the images
# is the bottom-right pixel of the filters when we
# is the bottom-right pixel of the filters when we
# do the layout here.
# do the layout here.
filters_padded
=
T
.
zeros
((
oc
,
ic
,
o0
,
o1
),
dtype
=
'float32'
)
filters_padded
=
T
.
zeros
((
oc
,
ic
,
o0
,
o1
),
dtype
=
'float32'
)
filters_padded
=
T
.
set_subtensor
(
filters_padded
[:,
:,
:
f0
,
:
f1
],
filters_padded
=
T
.
set_subtensor
(
filters_padded
[:,
:,
:
f0
,
:
f1
],
filters
)
filters
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论