Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
83abbce8
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
694
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
83abbce8
编写于
8月 21, 2017
作者:
G
guosheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Follow comments and refine ScaleShiftLayer
上级
7d2ef02a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
17 deletion
+17
-17
paddle/gserver/layers/ScaleShiftLayer.cpp
paddle/gserver/layers/ScaleShiftLayer.cpp
+3
-2
paddle/gserver/tests/test_LayerGrad.cpp
paddle/gserver/tests/test_LayerGrad.cpp
+2
-2
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+3
-2
python/paddle/trainer_config_helpers/tests/configs/protostr/test_scale_shift_layer.protostr
...rs/tests/configs/protostr/test_scale_shift_layer.protostr
+7
-7
python/paddle/trainer_config_helpers/tests/configs/test_scale_shift_layer.py
...er_config_helpers/tests/configs/test_scale_shift_layer.py
+2
-4
未找到文件。
paddle/gserver/layers/ScaleShiftLayer.cpp
浏览文件 @
83abbce8
...
...
@@ -17,8 +17,9 @@ limitations under the License. */
namespace
paddle
{
/**
* A layer does scaling and shifting to the input by appling a slope and
* an intercept which are trainable to the input element-wise.
* A layer applies a slope and an intercept to the input element-wise for
* scaling and shifting. Noting that this layer is trainable which differs
* from the SlopeInterceptLayer.
*
* \f[
* y = wx + b
...
...
paddle/gserver/tests/test_LayerGrad.cpp
浏览文件 @
83abbce8
...
...
@@ -2008,8 +2008,8 @@ TEST(Layer, RowL2NormLayer) {
}
TEST
(
Layer
,
ScaleShiftLayer
)
{
const
size_t
batchSize
=
1
28
;
const
size_t
size
=
51
2
;
const
size_t
batchSize
=
1
6
;
const
size_t
size
=
3
2
;
TestConfig
config
;
config
.
layerConfig
.
set_type
(
"scale_shift"
);
config
.
layerConfig
.
set_size
(
size
);
...
...
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
83abbce8
...
...
@@ -6219,8 +6219,9 @@ def kmax_sequence_score_layer(input, name=None, beam_size=1):
@
wrap_bias_attr_default
()
def
scale_shift_layer
(
input
,
name
=
None
,
param_attr
=
None
,
bias_attr
=
None
):
"""
A layer does scaling and shifting to the input by appling a slope and
an intercept which are trainable to the input element-wise.
A layer applies a slope and an intercept to the input element-wise for
scaling and shifting. Noting that this layer is trainable which differs
from the slope_intercept_layer.
.. math::
y = w * x + b
...
...
python/paddle/trainer_config_helpers/tests/configs/protostr/test_scale_shift_layer.protostr
浏览文件 @
83abbce8
...
...
@@ -14,7 +14,6 @@ layers {
input_layer_name: "data"
input_parameter_name: "___scale_shift_0__.w0"
}
bias_parameter_name: "___scale_shift_0__.wbias"
}
layers {
name: "__scale_shift_1__"
...
...
@@ -25,6 +24,7 @@ layers {
input_layer_name: "data"
input_parameter_name: "___scale_shift_1__.w0"
}
bias_parameter_name: "___scale_shift_1__.wbias"
}
parameters {
name: "___scale_shift_0__.w0"
...
...
@@ -37,24 +37,24 @@ parameters {
initial_smart: true
}
parameters {
name: "___scale_shift_
0__.wbias
"
name: "___scale_shift_
1__.w0
"
size: 1
initial_mean: 0.0
initial_std:
0
.0
initial_std:
1
.0
dims: 1
dims: 1
initial_strategy: 0
initial_smart:
fals
e
initial_smart:
tru
e
}
parameters {
name: "___scale_shift_1__.w
0
"
name: "___scale_shift_1__.w
bias
"
size: 1
initial_mean: 0.0
initial_std:
1
.0
initial_std:
0
.0
dims: 1
dims: 1
initial_strategy: 0
initial_smart:
tru
e
initial_smart:
fals
e
}
input_layer_names: "data"
output_layer_names: "__scale_shift_0__"
...
...
python/paddle/trainer_config_helpers/tests/configs/test_scale_shift_layer.py
浏览文件 @
83abbce8
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1000
,
learning_rate
=
1e-5
)
data
=
data_layer
(
name
=
'data'
,
size
=
100
)
scale
=
scale_shift_layer
(
input
=
data
)
scale
=
scale_shift_layer
(
input
=
data
,
bias_attr
=
False
)
scale_shift
=
scale_shift_layer
(
input
=
data
,
bias_attr
=
False
)
scale_shift
=
scale_shift_layer
(
input
=
data
)
outputs
(
scale
,
scale_shift
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录