Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
5b6b88ab
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看板
未验证
提交
5b6b88ab
编写于
12月 27, 2021
作者:
zhouweiwei2014
提交者:
GitHub
12月 27, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix english doc of some API (#38468)
上级
1ab5c511
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
28 addition
and
20 deletion
+28
-20
python/paddle/fluid/initializer.py
python/paddle/fluid/initializer.py
+5
-4
python/paddle/nn/initializer/dirac.py
python/paddle/nn/initializer/dirac.py
+4
-3
python/paddle/nn/initializer/orthogonal.py
python/paddle/nn/initializer/orthogonal.py
+12
-6
python/paddle/nn/utils/transform_parameters.py
python/paddle/nn/utils/transform_parameters.py
+2
-2
python/paddle/tensor/random.py
python/paddle/tensor/random.py
+5
-5
未找到文件。
python/paddle/fluid/initializer.py
浏览文件 @
5b6b88ab
...
...
@@ -1148,13 +1148,14 @@ def _global_bias_initializer():
def
calculate_gain
(
nonlinearity
,
param
=
None
):
"""
Get the recommended gain value of some nonlinearity function.
Get the recommended ``gain`` value of some nonlinearity function. ``gain`` value can be used in some
``paddle.nn.initializer`` api to adjust the initialization value.
Args:
nonlinearity(str): name of nonlinearity activation function. If it is a linear function,
which is one of
"linear/conv1d/conv2d/conv3d/conv1d_transpose/conv2d_transpose/conv3d_transpose"
, 1.0 will be returned.
nonlinearity(str): name of nonlinearity activation function. If it is a linear function,
such as:
`linear/conv1d/conv2d/conv3d/conv1d_transpose/conv2d_transpose/conv3d_transpose`
, 1.0 will be returned.
param(bool|int|float, optional): optional parameter for somme nonlinearity function. Now, it only applies to
'leaky_relu'. Default: None, it will be calculated as 0.01 in the formula.
'leaky_relu'. Default: None, it will be calculated as 0.01 in the formula.
Returns:
A float value, which is the recommended gain for this nonlinearity function.
...
...
python/paddle/nn/initializer/dirac.py
浏览文件 @
5b6b88ab
...
...
@@ -31,12 +31,13 @@ class Dirac(Initializer):
.. math::
Assuming: N=min(in\_channels, out\_channels)
X[d, d, shape[2]//2, shape[3]//2, ...]=1, \ d=0,1...N
where, ``N`` is the minimum value of ``in_channels`` and ``out_channels``
Args:
groups(int): 0-dimension of the Tensor will be divided by groups, each group has the same value.
groups(int, optional): 0-dimension of the Tensor will be divided by groups,
each group has the same value. Default: 1.
name(str, optional): The default value is None. Normally there is no need for user to set this
property. For more information, please refer to :ref:`api_guide_Name`.
...
...
python/paddle/nn/initializer/orthogonal.py
浏览文件 @
5b6b88ab
...
...
@@ -24,18 +24,24 @@ __all__ = []
class
Orthogonal
(
Initializer
):
"""The orthogonal initializer. The initialized tensor is (semi) orthogonal.
Assuming that 'weight' will be initialized, its shape is [M, N].
It's only applied to Tensor whose dimension is greater than or equal to 2.
For the Tensor whose dimension is greater than 2, the 0 dimension is seen as ``rows`` ,
and the >=1 dimension are flattened as ``cols`` .
Which can be describe as:
.. code-block:: text
if M < N:
rows = shape[0]
cols = shape[1]·shape[2]···shape[N]
if rows < cols:
The rows are orthogonal vectors
elif
M > N
:
elif
rows > cols
:
The columns are orthogonal vectors
else
M = N
:
else
rows = cols
:
Both rows and columns are orthogonal vectors
Only Tensor with 2 or more dimensions can initialized by Orthogonal.
Args:
gain(float, optional): The multiplication coefficient for initialized tensor. Default: 1.0.
...
...
python/paddle/nn/utils/transform_parameters.py
浏览文件 @
5b6b88ab
...
...
@@ -76,10 +76,10 @@ def parameters_to_vector(parameters, name=None):
@
dygraph_only
def
vector_to_parameters
(
vec
,
parameters
,
name
=
None
):
"""
Transform a
Tensor with 1-D shape to the parameters
.
Transform a
1-D Tensor to the input ``parameters``
.
Args:
vec (Tensor): A
Tensor with 1-D shape, which represents the parameters of a Layer
.
vec (Tensor): A
1-D Tensor, which will be sliced and copied to the input ``parameters``
.
parameters (Iterable[Tensor]): Iterable Tensors that are trainable parameters of a Layer.
name(str, optional): The default value is None. Normally there is no need for user to set this
property. For more information, please refer to :ref:`api_guide_Name`.
...
...
python/paddle/tensor/random.py
浏览文件 @
5b6b88ab
...
...
@@ -85,7 +85,7 @@ def poisson(x, name=None):
.. math::
out_i
~ Poisson (
x_i)
out_i
\sim Poisson (lambda =
x_i)
Args:
x(Tensor): A tensor with rate parameter of poisson Distribution. The data type
...
...
@@ -101,12 +101,12 @@ def poisson(x, name=None):
import paddle
paddle.set_device('cpu')
paddle.seed(
2021
)
paddle.seed(
100
)
x = paddle.uniform([2,3], min=1.0, max=5.0)
out = paddle.poisson(x)
#
[[2., 1., 4
.],
#
[4., 5., 1
.]]
#
[[2., 5., 0
.],
#
[5., 1., 3
.]]
"""
...
...
@@ -994,7 +994,7 @@ def exponential_(x, lam=1.0, name=None):
Args:
x(Tensor): Input tensor. The data type should be float32, float64.
lam(float
): :math:`\lambda` parameter of Exponential Distribution
.
lam(float
, optional): :math:`\lambda` parameter of Exponential Distribution. Default, 1.0
.
name(str, optional): The default value is None. Normally there is no
need for user to set this property. For more information, please
refer to :ref:`api_guide_Name`.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录