Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
8c582374
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看板
提交
8c582374
编写于
10月 17, 2018
作者:
C
chengduozh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update parameter doc
test=develop
上级
16822daa
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
51 addition
and
31 deletion
+51
-31
python/paddle/fluid/layers/nn.py
python/paddle/fluid/layers/nn.py
+40
-25
python/paddle/fluid/nets.py
python/paddle/fluid/nets.py
+11
-6
未找到文件。
python/paddle/fluid/layers/nn.py
浏览文件 @
8c582374
...
@@ -1277,12 +1277,15 @@ def sequence_conv(input,
...
@@ -1277,12 +1277,15 @@ def sequence_conv(input,
filter_size (int): the filter size (H and W).
filter_size (int): the filter size (H and W).
filter_stride (int): stride of the filter.
filter_stride (int): stride of the filter.
padding (bool): if True, add paddings.
padding (bool): if True, add paddings.
bias_attr (ParamAttr
): The parameter attribute for the bias of this layer
.
bias_attr (ParamAttr
|bool|None): The parameter attribute for the bias of sequence_conv
.
If it is set to False, no bias will be added to the output units.
If it is set to False, no bias will be added to the output units.
If it is set to None, the bias is initialized zero. Default: None.
If it is set to None or one attribute of ParamAttr, sequence_conv
will create ParamAttr as bias_attr. If the Initializer of the bias_attr
is not set, the bias is initialized zero. Default: None.
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
of this layer. If it is set to None, the parameter is initialized with
of sequence_conv. If it is set to None or one attribute of ParamAttr, sequence_conv
Xavier. Default: None.
will create ParamAttr as param_attr. If the Initializer of the param_attr
is not set, the parameter is initialized with Xavier. Default: None.
act (str): the activation type
act (str): the activation type
Returns:
Returns:
...
@@ -1491,14 +1494,17 @@ def conv2d(input,
...
@@ -1491,14 +1494,17 @@ def conv2d(input,
convolution in Alex Krizhevsky's Deep CNN paper: when group=2,
convolution in Alex Krizhevsky's Deep CNN paper: when group=2,
the first half of the filters is only connected to the first half
the first half of the filters is only connected to the first half
of the input channels, while the second half of the filters is only
of the input channels, while the second half of the filters is only
connected to the second half of the input channels. Default: groups=1
connected to the second half of the input channels. Default: groups=1
.
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
of this layer. If it is set to None, the parameter is initialized with
of conv2d. If it is set to None or one attribute of ParamAttr, conv2d
:math:`Normal(0.0, std)`, and the :math:`std` is :math:`(
\\
frac{2.0 }{filter\_elem\_num})^{0.5}`.
will create ParamAttr as param_attr. If the Initializer of the param_attr
Default: None.
is not set, the parameter is initialized with :math:`Normal(0.0, std)`,
bias_attr (ParamAttr): The parameter attribute for the bias of this layer.
and the :math:`std` is :math:`(
\\
frac{2.0 }{filter\_elem\_num})^{0.5}`. Default: None.
bias_attr (ParamAttr|bool|None): The parameter attribute for the bias of conv2d.
If it is set to False, no bias will be added to the output units.
If it is set to False, no bias will be added to the output units.
If it is set to None, the bias is initialized zero. Default: None.
If it is set to None or one attribute of ParamAttr, conv2d
will create ParamAttr as bias_attr. If the Initializer of the bias_attr
is not set, the bias is initialized zero. Default: None.
use_cudnn (bool): Use cudnn kernel or not, it is valid only when the cudnn
use_cudnn (bool): Use cudnn kernel or not, it is valid only when the cudnn
library is installed. Default: True
library is installed. Default: True
act (str): Activation type, if it is set to None, activation is not appended.
act (str): Activation type, if it is set to None, activation is not appended.
...
@@ -1550,8 +1556,8 @@ def conv2d(input,
...
@@ -1550,8 +1556,8 @@ def conv2d(input,
filter_shape
=
[
num_filters
,
int
(
num_filter_channels
)]
+
filter_size
filter_shape
=
[
num_filters
,
int
(
num_filter_channels
)]
+
filter_size
def
_get_default_param_initializer
():
def
_get_default_param_initializer
():
filter_
num_ele
m
=
filter_size
[
0
]
*
filter_size
[
1
]
*
num_channels
filter_
elem_nu
m
=
filter_size
[
0
]
*
filter_size
[
1
]
*
num_channels
std
=
(
2.0
/
(
filter_num_elem
)
)
**
0.5
std
=
(
2.0
/
filter_elem_num
)
**
0.5
return
Normal
(
0.0
,
std
,
0
)
return
Normal
(
0.0
,
std
,
0
)
filter_param
=
helper
.
create_parameter
(
filter_param
=
helper
.
create_parameter
(
...
@@ -1663,12 +1669,15 @@ def conv3d(input,
...
@@ -1663,12 +1669,15 @@ def conv3d(input,
of the input channels, while the second half of the filters is only
of the input channels, while the second half of the filters is only
connected to the second half of the input channels. Default: groups=1
connected to the second half of the input channels. Default: groups=1
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
of this layer. If it is set to None, the parameter is initialized with
of conv3d. If it is set to None or one attribute of ParamAttr, conv3d
:math:`Normal(0.0, std)`, and the :math:`std` is :math:`(
\\
frac{2.0 }{filter\_elem\_num})^{0.5}`.
will create ParamAttr as param_attr. If it is set to None, the parameter
Default: None.
is initialized with :math:`Normal(0.0, std)`, and the :math:`std` is
bias_attr (ParamAttr): The parameter attribute for the bias of this layer.
:math:`(
\\
frac{2.0 }{filter\_elem\_num})^{0.5}`. Default: None.
bias_attr (ParamAttr|bool|None): The parameter attribute for the bias of conv3d.
If it is set to False, no bias will be added to the output units.
If it is set to False, no bias will be added to the output units.
If it is set to None, the bias is initialized zero. Default: None.
If it is set to None or one attribute of ParamAttr, conv3d
will create ParamAttr as bias_attr. If the Initializer of the bias_attr
is not set, the bias is initialized zero. Default: None.
use_cudnn (bool): Use cudnn kernel or not, it is valid only when the cudnn
use_cudnn (bool): Use cudnn kernel or not, it is valid only when the cudnn
library is installed. Default: True
library is installed. Default: True
act (str): Activation type, if it is set to None, activation is not appended.
act (str): Activation type, if it is set to None, activation is not appended.
...
@@ -2413,11 +2422,14 @@ def conv2d_transpose(input,
...
@@ -2413,11 +2422,14 @@ def conv2d_transpose(input,
filters is only connected to the second half of the input channels.
filters is only connected to the second half of the input channels.
Default: groups = 1.
Default: groups = 1.
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
of this layer. If it is set to None, the parameter is initialized with
of conv2d_transpose. If it is set to None or one attribute of ParamAttr, conv2d_transpose
Xavier. Default: None.
will create ParamAttr as param_attr. If the Initializer of the param_attr
bias_attr (ParamAttr): The parameter attribute for the bias of this layer.
is not set, the parameter is initialized with Xavier. Default: None.
bias_attr (ParamAttr|bool|None): The parameter attribute for the bias of conv2d_transpose.
If it is set to False, no bias will be added to the output units.
If it is set to False, no bias will be added to the output units.
If it is set to None, the bias is initialized zero. Default: None.
If it is set to None or one attribute of ParamAttr, conv2d_transpose
will create ParamAttr as bias_attr. If the Initializer of the bias_attr
is not set, the bias is initialized zero. Default: None.
use_cudnn(bool): Use cudnn kernel or not, it is valid only when the cudnn
use_cudnn(bool): Use cudnn kernel or not, it is valid only when the cudnn
library is installed. Default: True.
library is installed. Default: True.
act (str): Activation type, if it is set to None, activation is not appended.
act (str): Activation type, if it is set to None, activation is not appended.
...
@@ -2598,11 +2610,14 @@ def conv3d_transpose(input,
...
@@ -2598,11 +2610,14 @@ def conv3d_transpose(input,
filters is only connected to the second half of the input channels.
filters is only connected to the second half of the input channels.
Default: groups=1
Default: groups=1
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
of this layer. If it is set to None, the parameter is initialized with
of conv3d_transpose. If it is set to None or one attribute of ParamAttr, conv3d_transpose
Xavier. Default: None.
will create ParamAttr as param_attr. If the Initializer of the param_attr
bias_attr (ParamAttr): The parameter attribute for the bias of this layer.
is not set, the parameter is initialized with Xavier. Default: None.
bias_attr (ParamAttr|bool|None): The parameter attribute for the bias of conv3d_transpose.
If it is set to False, no bias will be added to the output units.
If it is set to False, no bias will be added to the output units.
If it is set to None, the bias is initialized zero. Default: None.
If it is set to None or one attribute of ParamAttr, conv3d_transpose
will create ParamAttr as bias_attr. If the Initializer of the bias_attr
is not set, the bias is initialized zero. Default: None.
use_cudnn(bool): Use cudnn kernel or not, it is valid only when the cudnn
use_cudnn(bool): Use cudnn kernel or not, it is valid only when the cudnn
library is installed. Default: True
library is installed. Default: True
act (str): Activation type, if it is set to None, activation is not appended.
act (str): Activation type, if it is set to None, activation is not appended.
...
...
python/paddle/fluid/nets.py
浏览文件 @
8c582374
...
@@ -77,15 +77,20 @@ def simple_img_conv_pool(input,
...
@@ -77,15 +77,20 @@ def simple_img_conv_pool(input,
convolution in Alex Krizhevsky's Deep CNN paper: when group=2,
convolution in Alex Krizhevsky's Deep CNN paper: when group=2,
the first half of the filters is only connected to the first half
the first half of the filters is only connected to the first half
of the input channels, while the second half of the filters is only
of the input channels, while the second half of the filters is only
connected to the second half of the input channels. Default: groups=1
connected to the second half of the input channels. Default: groups=1
.
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
of conv2d. If it is set to None, the parameter is initialized with
of conv2d. If it is set to None or one attribute of ParamAttr, conv2d
:math:`Normal(0.0, std)`, and the :math:`std` is :math:`(
\\
frac{2.0 }{filter\_elem\_num})^{0.5}`.
will create ParamAttr as param_attr. If the Initializer of the param_attr
is not set, the parameter is initialized with :math:`Normal(0.0, std)`,
and the :math:`std` is :math:`(
\\
frac{2.0 }{filter\_elem\_num})^{0.5}`.
Default: None.
Default: None.
bias_attr (ParamAttr): The parameter attribute for the bias of conv2d.
bias_attr (ParamAttr
|bool|None
): The parameter attribute for the bias of conv2d.
If it is set to False, no bias will be added to the output units.
If it is set to False, no bias will be added to the output units.
If it is set to None, the bias is initialized zero. Default: None.
If it is set to None or one attribute of ParamAttr, conv2d
act (str): Activation type for Conv2d. Default: None
will create ParamAttr as bias_attr. If the Initializer of the bias_attr
is not set, the bias is initialized zero. Default: None.
act (str): Activation type for conv2d, if it is set to None, activation is not
appended. Default: None.
use_cudnn (bool): Use cudnn kernel or not, it is valid only when the cudnn
use_cudnn (bool): Use cudnn kernel or not, it is valid only when the cudnn
library is installed. Default: True
library is installed. Default: True
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录