fluid.regularizer

SourceEnglish

L1Decay

SourceEnglish

paddle.fluid.regularizer.L1Decay

L1DecayRegularizer 的别名

L1DecayRegularizer

SourceEnglish

class paddle.fluid.regularizer.L1DecayRegularizer(regularization_coeff=0.0)

实现 L1 权重衰减正则化。

L1正则将会稀疏化权重矩阵。

[\begin{split}\L1WeightDecay=reg_coeff∗sign(parameter)\\end{split}]

参数:

  • regularization_coeff (float) – 正则化系数

代码示例
  1. ioptimizer = fluid.optimizer.Adagrad(
  2. learning_rate=1e-4,
  3. regularization=fluid.regularizer.L1DecayRegularizer(
  4. regularization_coeff=0.1))
  5. optimizer.minimize(avg_cost)

L2Decay

SourceEnglish

paddle.fluid.regularizer.L2Decay

L2DecayRegularizer 的别名

L2DecayRegularizer

SourceEnglish

class paddle.fluid.regularizer.L2DecayRegularizer(regularization_coeff=0.0)

实现L2 权重衰减正则化。

较小的 L2 的有助于防止对训练数据的过度拟合。

[\begin{split}\L2WeightDecay=reg_coeff*parameter\\end{split}]

参数:

  • regularization_coeff (float) – 正则化系数

代码示例
  1. optimizer = fluid.optimizer.Adagrad(
  2. learning_rate=1e-4,
  3. regularization=fluid.regularizer.L2DecayRegularizer(
  4. regularization_coeff=0.1))
  5. optimizer.minimize(avg_cost)

原文: http://paddlepaddle.org/documentation/docs/zh/1.3/api_cn/regularizer_cn.html