padder v2 adam l2 regularization设置没有效果
Created by: xinrenax
版本是V2 模型是自编写的dnn,单机 对比 1.
optimizer = paddle.optimizer.Adam(
regularization=paddle.optimizer.L2Regularization(rate=8e-4),
model_average=paddle.optimizer.ModelAverage(average_window=0.5))
optimizer = paddle.optimizer.Adam(
regularization=paddle.optimizer.L2Regularization(rate=8e-2),
model_average=paddle.optimizer.ModelAverage(average_window=0.5))
二者训练的结果一样,看起来l2的正则并没有生效
训练片段1:
I0918 11:48:33.257062 5337 Util.cpp:166] commandline: --use_gpu=False --trainer_count=32
I0918 11:48:37.857172 5337 GradientMachine.cpp:85] Initing parameters..
I0918 11:48:42.531035 5337 GradientMachine.cpp:92] Init parameters done.
Pass 0, Batch 0, Cost 0.652811, {'auc_evaluator': 0.5572492480278015}
.................................................
Pass 0, Batch 50, Cost 0.314713, {'auc_evaluator': 0.6960048675537109}
.................................................
Pass 0, Batch 100, Cost 0.314877, {'auc_evaluator': 0.7025978565216064}
.................................................
Pass 0, Batch 150, Cost 0.314638, {'auc_evaluator': 0.7051900029182434}
.................................................
Pass 0, Batch 200, Cost 0.308577, {'auc_evaluator': 0.7053062915802002}
.................................................
训练片段2:
I0918 17:43:13.972120 40830 Util.cpp:166] commandline: --use_gpu=False --trainer_count=32
I0918 17:43:19.246784 40830 GradientMachine.cpp:85] Initing parameters..
I0918 17:43:23.758656 40830 GradientMachine.cpp:92] Init parameters done.
Pass 0, Batch 0, Cost 0.652811, {'auc_evaluator': 0.5572492480278015}
.................................................
Pass 0, Batch 50, Cost 0.314713, {'auc_evaluator': 0.6960048675537109}
.................................................
Pass 0, Batch 100, Cost 0.314877, {'auc_evaluator': 0.7025978565216064}