Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
055df470
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
055df470
编写于
6月 14, 2018
作者:
Y
yuyang18
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish code
上级
cbc1b7f1
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
30 addition
and
10 deletion
+30
-10
paddle/fluid/operators/activation_op.cc
paddle/fluid/operators/activation_op.cc
+5
-4
paddle/fluid/operators/row_conv_op.cc
paddle/fluid/operators/row_conv_op.cc
+1
-1
python/paddle/fluid/layers/ops.py
python/paddle/fluid/layers/ops.py
+24
-5
未找到文件。
paddle/fluid/operators/activation_op.cc
浏览文件 @
055df470
...
...
@@ -275,7 +275,7 @@ class HardShrinkOpMaker : public framework::OpProtoAndCheckerMaker {
"The value of threshold for HardShrink. [default: 0.5]"
)
.
SetDefault
(
0.5
f
);
AddComment
(
R"DOC(
** HardShrink activation operator **
:strong:`HardShrink activation operator`
.. math::
out = \begin{cases}
...
...
@@ -394,10 +394,11 @@ class ThresholdedReluOpMaker : public framework::OpProtoAndCheckerMaker {
void
Make
()
override
{
AddInput
(
"X"
,
"Input of ThresholdedRelu operator"
);
AddOutput
(
"Out"
,
"Output of ThresholdedRelu operator"
);
AddAttr
<
float
>
(
"threshold"
,
"The threshold location of activation"
)
AddAttr
<
float
>
(
"threshold"
,
"The threshold location of activation. [default 1.0]."
)
.
SetDefault
(
1.0
f
);
AddComment
(
R"DOC(
ThresholdedRelu Activation Operator.
:strong:`ThresholdedRelu activation operator`
.. math::
...
...
paddle/fluid/operators/row_conv_op.cc
浏览文件 @
055df470
...
...
@@ -94,7 +94,7 @@ class RowConvOpMaker : public framework::OpProtoAndCheckerMaker {
"in this LodTensor is a matrix with shape T x N, i.e., the "
"same shape as X."
);
AddComment
(
R"DOC(
** Row-convolution operator **
:strong:`Row-convolution operator`
The row convolution is called lookahead convolution. This operator was
introduced in the following paper for DeepSpeech2:
...
...
python/paddle/fluid/layers/ops.py
浏览文件 @
055df470
...
...
@@ -40,7 +40,6 @@ __activations__ = [
'relu6'
,
'pow'
,
'stanh'
,
'thresholded_relu'
,
'hard_sigmoid'
,
'swish'
,
]
...
...
@@ -91,8 +90,7 @@ def uniform_random(shape, dtype=None, min=None, max=None, seed=None):
return
_uniform_random_
(
**
kwargs
)
uniform_random
.
__doc__
=
_uniform_random_
.
__doc__
+
"
\n
"
\
+
"""
uniform_random
.
__doc__
=
_uniform_random_
.
__doc__
+
"""
Examples:
>>> result = fluid.layers.uniform_random(shape=[32, 784])
...
...
@@ -112,8 +110,7 @@ def hard_shrink(x, threshold=None):
return
_hard_shrink_
(
**
kwargs
)
hard_shrink
.
__doc__
=
_hard_shrink_
.
__doc__
+
"
\n
"
\
+
"""
hard_shrink
.
__doc__
=
_hard_shrink_
.
__doc__
+
"""
Examples:
>>> data = fluid.layers.data(name="input", shape=[784])
...
...
@@ -141,3 +138,25 @@ Examples:
>>> data = fluid.layers.data(name="input", shape=[32, 784])
>>> result = fluid.layers.cumsum(data, axis=0)
"""
__all__
+=
[
'thresholded_relu'
]
_thresholded_relu_
=
generate_layer_fn
(
'thresholded_relu'
)
def
thresholded_relu
(
x
,
threshold
=
None
):
kwargs
=
dict
()
for
name
in
locals
():
val
=
locals
()[
name
]
if
val
is
not
None
:
kwargs
[
name
]
=
val
_thresholded_relu_
(
**
kwargs
)
thresholded_relu
.
__doc__
=
_thresholded_relu_
.
__doc__
+
"""
Examples:
>>> data = fluid.layers.data(name="input", shape=[1])
>>> result = fluid.layers.thresholded_relu(data, threshold=0.4)
"""
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录