Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
daea21a5
提交
daea21a5
authored
7月 26, 2017
作者:
João Victor Risso
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add docstrings for make_node functions of GpuDnnTransformerSampler and GpuDnnTransformerGrid
Signed-off-by:
João Victor Risso
<
joaovictor.risso@gmail.com
>
上级
5510faf5
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
32 行增加
和
1 行删除
+32
-1
dnn.py
theano/gpuarray/dnn.py
+32
-1
没有找到文件。
theano/gpuarray/dnn.py
浏览文件 @
daea21a5
...
@@ -2806,6 +2806,19 @@ class GpuDnnTransformerGrid(DnnBase):
...
@@ -2806,6 +2806,19 @@ class GpuDnnTransformerGrid(DnnBase):
DnnBase
.
__init__
(
self
,
[
"c_code/dnn_sptf_grid.c"
],
"APPLY_SPECIFIC(dnn_sptf_grid)"
)
DnnBase
.
__init__
(
self
,
[
"c_code/dnn_sptf_grid.c"
],
"APPLY_SPECIFIC(dnn_sptf_grid)"
)
def
make_node
(
self
,
theta
,
desc
):
def
make_node
(
self
,
theta
,
desc
):
"""
Create a grid generator node for a cuDNN Spatial Transformer
Parameters
----------
theta : tensor
Affine transformation tensor containing one affine transformation
matrix per image. ``theta`` is usually generated by the localization
network.
desc : GpuDnnTransformerDesc
Spatial transformer descriptor
"""
context_name
=
infer_context_name
(
desc
)
context_name
=
infer_context_name
(
desc
)
if
(
not
isinstance
(
desc
.
type
,
CDataType
)
or
if
(
not
isinstance
(
desc
.
type
,
CDataType
)
or
...
@@ -2856,6 +2869,24 @@ class GpuDnnTransformerSampler(DnnBase):
...
@@ -2856,6 +2869,24 @@ class GpuDnnTransformerSampler(DnnBase):
DnnBase
.
__init__
(
self
,
[
"c_code/dnn_sptf_sampler.c"
],
"APPLY_SPECIFIC(dnn_sptf_sampler)"
)
DnnBase
.
__init__
(
self
,
[
"c_code/dnn_sptf_sampler.c"
],
"APPLY_SPECIFIC(dnn_sptf_sampler)"
)
def
make_node
(
self
,
img
,
grid
,
desc
):
def
make_node
(
self
,
img
,
grid
,
desc
):
"""
Create a grid sampler node for a cuDNN Spatial Transformer
Parameters
----------
img : tensor
Images from which the pixels will be sampled. The implementation
assumes the tensor is in NCHW format, where N is the number of images,
C is the number of color channels, H is the height of the inputs, and
W is width of the inputs.
grid : GpuDnnTransformerGrid
Grid that contains the coordinates of the pixels to be sampled from
the inputs images.
desc : GpuDnnTransformerDesc
Spatial transformer descriptor
"""
context_name
=
infer_context_name
(
desc
)
context_name
=
infer_context_name
(
desc
)
if
(
not
isinstance
(
desc
.
type
,
CDataType
)
or
if
(
not
isinstance
(
desc
.
type
,
CDataType
)
or
...
@@ -3012,7 +3043,7 @@ def dnn_spatialtf(img, theta, scale_width=1, scale_height=1, precision=theano.co
...
@@ -3012,7 +3043,7 @@ def dnn_spatialtf(img, theta, scale_width=1, scale_height=1, precision=theano.co
Currently, cuDNN only supports 2D transformations with 2x3 affine
Currently, cuDNN only supports 2D transformations with 2x3 affine
transformation matrices.
transformation matrices.
Also, the only grid sampler method available is the bilinear interpolation
.
Bilinear interpolation is the only grid sampler method available
.
"""
"""
out_dims
=
(
img
.
shape
[
0
],
img
.
shape
[
1
],
out_dims
=
(
img
.
shape
[
0
],
img
.
shape
[
1
],
theano
.
tensor
.
ceil
(
img
.
shape
[
2
]
*
scale_height
),
theano
.
tensor
.
ceil
(
img
.
shape
[
2
]
*
scale_height
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论