码迷,mamicode.com
首页 > 其他好文 > 详细

keras 添加L2正则 和 dropout层

时间:2019-10-06 00:20:03      阅读:308      评论:0      收藏:0      [点我收藏+]

标签:正则   imp   layer   bsp   col   span   add   regular   style   

在某一层添加L2正则:

from keras import regularizer
model.add(layers.Dense(..., kernel_regularizer = regularizers(0.001),...))

在某一层之后添加dropout层:

model.add(layers.Dropout(0.5))

 

keras 添加L2正则 和 dropout层

标签:正则   imp   layer   bsp   col   span   add   regular   style   

原文地址:https://www.cnblogs.com/rising-sun/p/11625963.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!