Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
73dcf2cd
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
73dcf2cd
编写于
2月 03, 2017
作者:
H
Haonan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improving code comments
上级
6245fed2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
5 deletion
+7
-5
paddle/gserver/layers/RotateLayer.cpp
paddle/gserver/layers/RotateLayer.cpp
+2
-1
paddle/gserver/layers/RotateLayer.h
paddle/gserver/layers/RotateLayer.h
+1
-1
paddle/gserver/tests/test_LayerGrad.cpp
paddle/gserver/tests/test_LayerGrad.cpp
+2
-1
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+2
-2
未找到文件。
paddle/gserver/layers/RotateLayer.cpp
浏览文件 @
73dcf2cd
...
@@ -38,7 +38,8 @@ void RotateLayer::forward(PassType passType) {
...
@@ -38,7 +38,8 @@ void RotateLayer::forward(PassType passType) {
size_
=
input
->
getWidth
();
size_
=
input
->
getWidth
();
CHECK_GE
(
size_
,
height_
*
width_
);
CHECK_GE
(
size_
,
height_
*
width_
);
CHECK_EQ
(
size_
%
(
height_
*
width_
),
0
)
CHECK_EQ
(
size_
%
(
height_
*
width_
),
0
)
<<
"The input's depth should be an int"
;
<<
"total size_ is not dividable by (height_ * width_), i.e., "
<<
"channel number should be an integer"
;
channels_
=
size_
/
(
height_
*
width_
);
channels_
=
size_
/
(
height_
*
width_
);
resizeOutput
(
batchSize_
,
size_
);
resizeOutput
(
batchSize_
,
size_
);
...
...
paddle/gserver/layers/RotateLayer.h
浏览文件 @
73dcf2cd
...
@@ -21,7 +21,7 @@ namespace paddle {
...
@@ -21,7 +21,7 @@ namespace paddle {
/**
/**
* A layer for rotating a multi-channel feature map (M x N x C) in the spatial
* A layer for rotating a multi-channel feature map (M x N x C) in the spatial
* domain
* domain
* The rotation is 90 degrees in clock-wise
* The rotation is 90 degrees in clock-wise
for each channel
* \f[
* \f[
* y(j,i,:) = x(M-i-1,j,:)
* y(j,i,:) = x(M-i-1,j,:)
* \f]
* \f]
...
...
paddle/gserver/tests/test_LayerGrad.cpp
浏览文件 @
73dcf2cd
...
@@ -1320,9 +1320,10 @@ TEST(Layer, RotateLayer) {
...
@@ -1320,9 +1320,10 @@ TEST(Layer, RotateLayer) {
TestConfig
config
;
TestConfig
config
;
config
.
biasSize
=
0
;
config
.
biasSize
=
0
;
config
.
layerConfig
.
set_type
(
"rotate"
);
config
.
layerConfig
.
set_type
(
"rotate"
);
const
int
INPUT_SIZE
=
64
;
// height * width * depth
const
int
CHANNEL
=
2
;
const
int
HEIGHT
=
8
;
const
int
HEIGHT
=
8
;
const
int
WIDTH
=
4
;
const
int
WIDTH
=
4
;
const
int
INPUT_SIZE
=
HEIGHT
*
WIDTH
*
CHANNEL
;
config
.
layerConfig
.
set_size
(
INPUT_SIZE
);
config
.
layerConfig
.
set_size
(
INPUT_SIZE
);
config
.
layerConfig
.
set_height
(
HEIGHT
);
config
.
layerConfig
.
set_height
(
HEIGHT
);
config
.
layerConfig
.
set_width
(
WIDTH
);
config
.
layerConfig
.
set_width
(
WIDTH
);
...
...
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
73dcf2cd
...
@@ -1679,8 +1679,8 @@ def trans_layer(input, name=None, layer_attr=None):
...
@@ -1679,8 +1679,8 @@ def trans_layer(input, name=None, layer_attr=None):
@
layer_support
()
@
layer_support
()
def
rotate_layer
(
input
,
height
,
width
,
name
=
None
,
layer_attr
=
None
):
def
rotate_layer
(
input
,
height
,
width
,
name
=
None
,
layer_attr
=
None
):
"""
"""
A layer for rotating 90 degrees (clock-wise)
, usually used when the input sample
A layer for rotating 90 degrees (clock-wise)
for each feature channel,
is some image or feature map.
usually used when the input sample
is some image or feature map.
.. math::
.. math::
y(j,i,:) = x(M-i-1,j,:)
y(j,i,:) = x(M-i-1,j,:)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录