Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
a74db488
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a74db488
编写于
12月 21, 2017
作者:
C
caoying03
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
follow comments.
上级
ebe4425f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
81 addition
and
81 deletion
+81
-81
doc/api/v2/config/layer.rst
doc/api/v2/config/layer.rst
+2
-2
doc/api/v2/fluid/layers.rst
doc/api/v2/fluid/layers.rst
+40
-40
doc/api/v2/fluid/nets.rst
doc/api/v2/fluid/nets.rst
+3
-3
doc/api/v2/fluid/optimizer.rst
doc/api/v2/fluid/optimizer.rst
+4
-4
doc/api/v2/fluid/regularizer.rst
doc/api/v2/fluid/regularizer.rst
+3
-3
paddle/operators/mul_op.cc
paddle/operators/mul_op.cc
+25
-26
python/paddle/v2/fluid/layers/nn.py
python/paddle/v2/fluid/layers/nn.py
+4
-3
未找到文件。
doc/api/v2/config/layer.rst
浏览文件 @
a74db488
...
@@ -467,7 +467,7 @@ lambda_cost
...
@@ -467,7 +467,7 @@ lambda_cost
:noindex:
:noindex:
square_error_cost
square_error_cost
--------
--------
---------
.. autoclass:: paddle.v2.layer.square_error_cost
.. autoclass:: paddle.v2.layer.square_error_cost
:noindex:
:noindex:
...
@@ -533,7 +533,7 @@ Miscs
...
@@ -533,7 +533,7 @@ Miscs
=====
=====
dropout
dropout
--------
------
--------
.. autoclass:: paddle.v2.layer.dropout
.. autoclass:: paddle.v2.layer.dropout
:noindex:
:noindex:
...
...
doc/api/v2/fluid/layers.rst
浏览文件 @
a74db488
...
@@ -19,17 +19,17 @@ dynamic_lstm
...
@@ -19,17 +19,17 @@ dynamic_lstm
:noindex:
:noindex:
data
data
----
-----
----
.. autofunction:: paddle.v2.fluid.layers.data
.. autofunction:: paddle.v2.fluid.layers.data
:noindex:
:noindex:
mean
mean
----
-----
----
.. autofunction:: paddle.v2.fluid.layers.mean
.. autofunction:: paddle.v2.fluid.layers.mean
:noindex:
:noindex:
mul
mul
---
------
---
.. autofunction:: paddle.v2.fluid.layers.mul
.. autofunction:: paddle.v2.fluid.layers.mul
:noindex:
:noindex:
...
@@ -45,13 +45,13 @@ elementwise_div
...
@@ -45,13 +45,13 @@ elementwise_div
dropout
dropout
-------
--
-------
.. autofunction:: paddle.v2.fluid.layers.dropout
.. autofunction:: paddle.v2.fluid.layers.dropout
:noindex:
:noindex:
reshape
reshape
--------
-
--------
.. autofunction:: paddle.v2.fluid.layers.reshape
.. autofunction:: paddle.v2.fluid.layers.reshape
:noindex:
:noindex:
...
@@ -81,67 +81,67 @@ transpose
...
@@ -81,67 +81,67 @@ transpose
sigmoid_cross_entropy_with_logits
sigmoid_cross_entropy_with_logits
---------
---------
------------------------
.. autofunction:: paddle.v2.fluid.layers.esigmoid_cross_entropy_with_logits
.. autofunction:: paddle.v2.fluid.layers.esigmoid_cross_entropy_with_logits
:noindex:
:noindex:
cast
cast
----
-----
----
.. autofunction:: paddle.v2.fluid.layers.cast
.. autofunction:: paddle.v2.fluid.layers.cast
:noindex:
:noindex:
concat
concat
-------
--
-------
.. autofunction:: paddle.v2.fluid.layers.concat
.. autofunction:: paddle.v2.fluid.layers.concat
:noindex:
:noindex:
sums
sums
----
-----
----
.. autofunction:: paddle.v2.fluid.layers.sums
.. autofunction:: paddle.v2.fluid.layers.sums
:noindex:
:noindex:
linear_chain_crf
linear_chain_crf
---------
---------
-------
.. autofunction:: paddle.v2.fluid.layers.linear_chain_crf
.. autofunction:: paddle.v2.fluid.layers.linear_chain_crf
:noindex:
:noindex:
assign
assign
-------
--
-------
.. autofunction:: paddle.v2.fluid.layers.embedding
.. autofunction:: paddle.v2.fluid.layers.embedding
:noindex:
:noindex:
split_lod_tensor
split_lod_tensor
---------
---------
-------
.. autofunction:: paddle.v2.fluid.layers.split_lod_tensor
.. autofunction:: paddle.v2.fluid.layers.split_lod_tensor
:noindex:
:noindex:
merge_lod_tensor
merge_lod_tensor
---------
---------
-------
.. autofunction:: paddle.v2.fluid.layers.merge_lod_tensor
.. autofunction:: paddle.v2.fluid.layers.merge_lod_tensor
:noindex:
:noindex:
cos_sim
cos_sim
--------
-
--------
.. autofunction:: paddle.v2.fluid.layers.cos_sim
.. autofunction:: paddle.v2.fluid.layers.cos_sim
:noindex:
:noindex:
cross_entropy
cross_entropy
---------
---------
----
.. autofunction:: paddle.v2.fluid.layers.cross_entropy
.. autofunction:: paddle.v2.fluid.layers.cross_entropy
:noindex:
:noindex:
square_error_cost
square_error_cost
---------
---------
--------
.. autofunction:: paddle.v2.fluid.layers.square_error_cost
.. autofunction:: paddle.v2.fluid.layers.square_error_cost
:noindex:
:noindex:
...
@@ -153,68 +153,68 @@ accuracy
...
@@ -153,68 +153,68 @@ accuracy
sequence_conv
sequence_conv
---------
---------
----
.. autofunction:: paddle.v2.fluid.layers.sequence_conv
.. autofunction:: paddle.v2.fluid.layers.sequence_conv
:noindex:
:noindex:
conv2d
conv2d
------
---
------
.. autofunction:: paddle.v2.fluid.layers.conv2d
.. autofunction:: paddle.v2.fluid.layers.conv2d
:noindex:
:noindex:
sequence_pool
sequence_pool
---------
---------
----
.. autofunction:: paddle.v2.fluid.layers.sequence_pool
.. autofunction:: paddle.v2.fluid.layers.sequence_pool
:noindex:
:noindex:
pool2d
pool2d
------
---
------
.. autofunction:: paddle.v2.fluid.layers.pool2d
.. autofunction:: paddle.v2.fluid.layers.pool2d
:noindex:
:noindex:
batch_norm
batch_norm
---------
---------
-
.. autofunction:: paddle.v2.fluid.layers.batch_norm
.. autofunction:: paddle.v2.fluid.layers.batch_norm
:noindex:
:noindex:
beam_search_decode
beam_search_decode
---------
---------
---------
.. autofunction:: paddle.v2.fluid.layers.beam_search_decode
.. autofunction:: paddle.v2.fluid.layers.beam_search_decode
:noindex:
:noindex:
lod_rank_table
lod_rank_table
---------
---------
-----
.. autofunction:: paddle.v2.fluid.layers.lod_rank_table
.. autofunction:: paddle.v2.fluid.layers.lod_rank_table
:noindex:
:noindex:
max_sequence_len
max_sequence_len
---------
---------
-------
.. autofunction:: paddle.v2.fluid.layers.max_sequence_len
.. autofunction:: paddle.v2.fluid.layers.max_sequence_len
:noindex:
:noindex:
topk
topk
-----
----
-----
.. autofunction:: paddle.v2.fluid.layers.topk
.. autofunction:: paddle.v2.fluid.layers.topk
:noindex:
:noindex:
lod_tensor_to_array
lod_tensor_to_array
---------
---------
----------
.. autofunction:: paddle.v2.fluid.layers.lod_tensor_to_array
.. autofunction:: paddle.v2.fluid.layers.lod_tensor_to_array
:noindex:
:noindex:
array_to_lod_tensor
array_to_lod_tensor
---------
---------
----------
.. autofunction:: paddle.v2.fluid.layers.array_to_lod_tensor
.. autofunction:: paddle.v2.fluid.layers.array_to_lod_tensor
:noindex:
:noindex:
...
@@ -222,26 +222,26 @@ array_to_lod_tensor
...
@@ -222,26 +222,26 @@ array_to_lod_tensor
fill_constant
fill_constant
---------
---------
----
.. autofunction:: paddle.v2.fluid.layers.fill_constant
.. autofunction:: paddle.v2.fluid.layers.fill_constant
:noindex:
:noindex:
fill_constant_batch_size_like
fill_constant_batch_size_like
---------
---------
--------------------
.. autofunction:: paddle.v2.fluid.layers.fill_constant_batch_size_like
.. autofunction:: paddle.v2.fluid.layers.fill_constant_batch_size_like
:noindex:
:noindex:
ones
ones
----
-----
----
.. autofunction:: paddle.v2.fluid.layers.ones
.. autofunction:: paddle.v2.fluid.layers.ones
:noindex:
:noindex:
zeros
zeros
-----
----
-----
.. autofunction:: paddle.v2.fluid.layers.zeros
.. autofunction:: paddle.v2.fluid.layers.zeros
:noindex:
:noindex:
...
@@ -253,14 +253,14 @@ increment
...
@@ -253,14 +253,14 @@ increment
array_write
array_write
---------
---------
--
.. autofunction:: paddle.v2.fluid.layers.array_write
.. autofunction:: paddle.v2.fluid.layers.array_write
:noindex:
:noindex:
create_array
create_array
---------
---------
---
.. autofunction:: paddle.v2.fluid.layers.create_array
.. autofunction:: paddle.v2.fluid.layers.create_array
:noindex:
:noindex:
...
@@ -272,31 +272,31 @@ less_than
...
@@ -272,31 +272,31 @@ less_than
array_read
array_read
---------
---------
-
.. autofunction:: paddle.v2.fluid.layers.array_read
.. autofunction:: paddle.v2.fluid.layers.array_read
:noindex:
:noindex:
shrink_memory
shrink_memory
---------
---------
-----
.. autofunction:: paddle.v2.fluid.layers.shrink_memory
.. autofunction:: paddle.v2.fluid.layers.shrink_memory
:noindex:
:noindex:
array_length
array_length
---------
---------
----
.. autofunction:: paddle.v2.fluid.layers.array_length
.. autofunction:: paddle.v2.fluid.layers.array_length
:noindex:
:noindex:
conv2d_transpose
conv2d_transpose
---------
---------
-------
.. autofunction:: paddle.v2.fluid.layers.conv2d_transpose
.. autofunction:: paddle.v2.fluid.layers.conv2d_transpose
:noindex:
:noindex:
sequence_expand
sequence_expand
---------
---------
------
.. autofunction:: paddle.v2.fluid.layers.sequence_expand
.. autofunction:: paddle.v2.fluid.layers.sequence_expand
:noindex:
:noindex:
...
@@ -308,13 +308,13 @@ lstm_unit
...
@@ -308,13 +308,13 @@ lstm_unit
sequence_softmax
sequence_softmax
---------
---------
-------
.. autofunction:: paddle.v2.fluid.layers.sequence_softmax
.. autofunction:: paddle.v2.fluid.layers.sequence_softmax
:noindex:
:noindex:
reduce_sum
reduce_sum
---------
---------
-
.. autofunction:: paddle.v2.fluid.layers.reduce_sum
.. autofunction:: paddle.v2.fluid.layers.reduce_sum
:noindex:
:noindex:
doc/api/v2/fluid/nets.rst
浏览文件 @
a74db488
...
@@ -3,19 +3,19 @@ Nets
...
@@ -3,19 +3,19 @@ Nets
===========
===========
simple_img_conv_pool
simple_img_conv_pool
-----------
-----------
---------
.. autofunction:: paddle.v2.fluid.nets.simple_img_conv_pool
.. autofunction:: paddle.v2.fluid.nets.simple_img_conv_pool
:noindex:
:noindex:
img_conv_group
img_conv_group
-----------
-----------
----
.. autofunction:: paddle.v2.fluid.nets.img_conv_group
.. autofunction:: paddle.v2.fluid.nets.img_conv_group
:noindex:
:noindex:
sequence_conv_pool
sequence_conv_pool
-----------
-----------
-------
.. autofunction:: paddle.v2.fluid.nets.sequence_conv_pool
.. autofunction:: paddle.v2.fluid.nets.sequence_conv_pool
:noindex:
:noindex:
...
...
doc/api/v2/fluid/optimizer.rst
浏览文件 @
a74db488
...
@@ -18,7 +18,7 @@ SGDOptimizer
...
@@ -18,7 +18,7 @@ SGDOptimizer
MomentumOptimizer
MomentumOptimizer
-----------
-----------
------
.. automodule:: paddle.v2.fluid.optimizer
.. automodule:: paddle.v2.fluid.optimizer
:members: MomentumOptimizer
:members: MomentumOptimizer
:noindex:
:noindex:
...
@@ -26,14 +26,14 @@ MomentumOptimizer
...
@@ -26,14 +26,14 @@ MomentumOptimizer
AdagradOptimizer
AdagradOptimizer
-----------
-----------
-----
.. automodule:: paddle.v2.fluid.optimizer
.. automodule:: paddle.v2.fluid.optimizer
:members: AdagradOptimizer
:members: AdagradOptimizer
:noindex:
:noindex:
AdamOptimizer
AdamOptimizer
-----------
-----------
--
.. automodule:: paddle.v2.fluid.optimizer
.. automodule:: paddle.v2.fluid.optimizer
:members: AdamOptimizer
:members: AdamOptimizer
:noindex:
:noindex:
...
@@ -47,7 +47,7 @@ AdamaxOptimizer
...
@@ -47,7 +47,7 @@ AdamaxOptimizer
DecayedAdagradOptimizer
DecayedAdagradOptimizer
-----------
-----------
------------
.. automodule:: paddle.v2.fluid.optimizer
.. automodule:: paddle.v2.fluid.optimizer
:members: DecayedAdagradOptimizer
:members: DecayedAdagradOptimizer
:noindex:
:noindex:
...
...
doc/api/v2/fluid/regularizer.rst
浏览文件 @
a74db488
...
@@ -3,14 +3,14 @@ Regularizer
...
@@ -3,14 +3,14 @@ Regularizer
===========
===========
WeightDecayRegularizer
WeightDecayRegularizer
-----------
-----------
-----------
.. automodule:: paddle.v2.fluid.regularizer
.. automodule:: paddle.v2.fluid.regularizer
:members: WeightDecayRegularizer
:members: WeightDecayRegularizer
:noindex:
:noindex:
L2DecayRegularizer
L2DecayRegularizer
-----------
-----------
-------
.. automodule:: paddle.v2.fluid.regularizer
.. automodule:: paddle.v2.fluid.regularizer
:members: L2DecayRegularizer
:members: L2DecayRegularizer
:noindex:
:noindex:
...
@@ -18,7 +18,7 @@ L2DecayRegularizer
...
@@ -18,7 +18,7 @@ L2DecayRegularizer
L1DecayRegularizer
L1DecayRegularizer
-----------
-----------
--------
.. automodule:: paddle.v2.fluid.regularizer
.. automodule:: paddle.v2.fluid.regularizer
:members: L1DecayRegularizer
:members: L1DecayRegularizer
...
...
paddle/operators/mul_op.cc
浏览文件 @
a74db488
...
@@ -73,36 +73,35 @@ class MulOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -73,36 +73,35 @@ class MulOpMaker : public framework::OpProtoAndCheckerMaker {
public:
public:
MulOpMaker
(
OpProto
*
proto
,
OpAttrChecker
*
op_checker
)
MulOpMaker
(
OpProto
*
proto
,
OpAttrChecker
*
op_checker
)
:
OpProtoAndCheckerMaker
(
proto
,
op_checker
)
{
:
OpProtoAndCheckerMaker
(
proto
,
op_checker
)
{
AddInput
(
"X"
,
"
The first input tensor of the
mul op."
);
AddInput
(
"X"
,
"
(Tensor), The first input tensor of
mul op."
);
AddInput
(
"Y"
,
"
The second input tensor of the
mul op."
);
AddInput
(
"Y"
,
"
(Tensor), The second input tensor of
mul op."
);
AddOutput
(
"Out"
,
"
The output tensor of the
mul op."
);
AddOutput
(
"Out"
,
"
(Tensor), The output tensor of
mul op."
);
AddAttr
<
int
>
(
AddAttr
<
int
>
(
"x_num_col_dims"
,
"x_num_col_dims"
,
"(int, default 1) "
R"DOC((int, default 1), The mul_op can take tensors with more than two
R"DOC(The mul_op can take tensors with more than two dimensions as its
dimensions as its inputs. If the input $X$ is a tensor with more
inputs. If the input `X` is a tensor with more than two
than two dimensions, $X$ will be flattened into a two-dimensional
dimensions, `X` will be flattened into a two-dimensional matrix
matrix first. The flattening rule is: the first `num_col_dims`
first. The flattening rule is: the first `num_col_dims` will be
will be flattened to form the first dimension of the final matrix
flattened to form the first dimension of the final matrix (height
(the height of the matrix), and the rest `rank(X) - num_col_dims`
of the matrix), and the rest `rank(X) - num_col_dims` dimensions
dimensions are flattened to form the second dimension of the final
are flattened to form the second dimension of the final matrix (
matrix (the width of the matrix). As a result, height of the
width of the matrix). As a result, height of the flattened matrix
flattened matrix is equal to the product of $X$'s first
is equal to the product of `X`'s first `x_num_col_dims` dimensions'
`x_num_col_dims` dimensions' sizes, and width of the flattened
sizes, and width of the flattened matrix is equal to the product
matrix is equal to the product of $X$'s last `rank(x) - num_col_dims`
of `X`'s last `rank(x) - num_col_dims` dimensions' size.
dimensions' size. For example, suppose $X$ is a 6-dimensional
For example, suppose `X` is a 6-dimensional tensor with the shape
tensor with the shape [2, 3, 4, 5, 6], and `x_num_col_dims` = 3.
[2, 3, 4, 5, 6], and `x_num_col_dims` = 3. Then, the flattened
Thus, the flattened matrix will have a shape [2 x 3 x 4, 5 x 6] =
matrix will have a shape [2 x 3 x 4, 5 x 6] =
[24, 30].
[24, 30].
)DOC"
)
)DOC"
)
.
SetDefault
(
1
)
.
SetDefault
(
1
)
.
EqualGreaterThan
(
1
);
.
EqualGreaterThan
(
1
);
AddAttr
<
int
>
(
AddAttr
<
int
>
(
"y_num_col_dims"
,
"y_num_col_dims"
,
"(int, default 1) "
R"DOC((int, default 1), The mul_op can take tensors with more than two,
R"DOC(The mul_op can take tensors with more than two dimensions as its
dimensions as its inputs. If the input $Y$ is a tensor with more
inputs. If the input `Y` is a tensor with more than two
than two dimensions, $Y$ will be flattened into a two-dimensional
dimensions, `Y` will be flatten into a two-dimensional matrix
matrix first. The attribute `y_num_col_dims` determines how $Y$ is
first. The attribute `y_num_col_dims` determines how `Y` is
flattened. See comments of `x_num_col_dims` for more details.
flattened. See comments of `x_num_col_dims` for more details.
)DOC"
)
)DOC"
)
.
SetDefault
(
1
)
.
SetDefault
(
1
)
...
@@ -110,14 +109,14 @@ class MulOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -110,14 +109,14 @@ class MulOpMaker : public framework::OpProtoAndCheckerMaker {
AddComment
(
R"DOC(
AddComment
(
R"DOC(
Mul Operator.
Mul Operator.
This operator is used to perform matrix multiplication for input
X and Y
.
This operator is used to perform matrix multiplication for input
$X$ and $Y$
.
The equation is:
The equation is:
$$Out = X * Y$$
$$Out = X * Y$$
Both the input
`X` and `Y`
can carry the LoD (Level of Details) information,
Both the input
$X$ and $Y$
can carry the LoD (Level of Details) information,
or not. But the output only shares the LoD information with input
`X`
.
or not. But the output only shares the LoD information with input
$X$
.
)DOC"
);
)DOC"
);
}
}
...
...
python/paddle/v2/fluid/layers/nn.py
浏览文件 @
a74db488
...
@@ -40,7 +40,8 @@ def fc(input,
...
@@ -40,7 +40,8 @@ def fc(input,
This process can be formulated as follows:
This process can be formulated as follows:
.. math::
.. math::
Out = Act({\sum_{i=0}^{N-1}W_iX_i + b})
Out = Act\left({\sum_{i=0}^{N-1}W_iX_i + b}
\r
ight)
In the above equation:
In the above equation:
...
@@ -48,8 +49,8 @@ def fc(input,
...
@@ -48,8 +49,8 @@ def fc(input,
* :math:`X_i`: The input tensor.
* :math:`X_i`: The input tensor.
* :math:`W`: The weights created by this layer.
* :math:`W`: The weights created by this layer.
* :math:`b`: The bias parameter created by this layer (if needed).
* :math:`b`: The bias parameter created by this layer (if needed).
* :math`Act`: The activation funtion.
* :math
:
`Act`: The activation funtion.
* :math`Out`: The output tensor.
* :math
:
`Out`: The output tensor.
Args:
Args:
input(Variable|list): The input tensor(s) to the fully connected layer.
input(Variable|list): The input tensor(s) to the fully connected layer.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录