TruncatedNormalInitializer_cn.rst 763 字节
Newer Older
H
Hao Wang 已提交
1 2 3 4 5 6 7
.. _cn_api_fluid_initializer_TruncatedNormalInitializer:

TruncatedNormalInitializer
-------------------------------

.. py:class:: paddle.fluid.initializer.TruncatedNormalInitializer(loc=0.0, scale=1.0, seed=0)

8
Random Truncated Normal(高斯)分布初始化函数
H
Hao Wang 已提交
9 10

参数:
11 12 13 14 15 16
    - **loc** (float16|float32) - 正态分布的平均值
    - **scale** (float16|float32) - 正态分布的标准差
    - **seed** (int32) - 随机种子

返回:对象

H
Hao Wang 已提交
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
**代码示例**

.. code-block:: python

        import paddle.fluid as fluid
        x = fluid.layers.data(name='x', shape=[1], dtype='float32')
        fc = fluid.layers.fc(input=x, size=10,
            param_attr=fluid.initializer.TruncatedNormal(loc=0.0, scale=2.0))