UniformInitializer

  • class paddle.fluid.initializer.UniformInitializer(low=-1.0, high=1.0, seed=0)[源代码]

随机均匀分布初始化器

  • 参数:
    • low (float16|float32) - 下界
    • high (float16|float32) - 上界
    • seed (int32) - 随机种子

返回:对象

代码示例

  1. import paddle.fluid as fluid
  2. x = fluid.layers.data(name='x', shape=[1], dtype='float32')
  3. fc = fluid.layers.fc(input=x, size=10,
  4. param_attr=fluid.initializer.Uniform(low=-0.5, high=0.5))