在某一层添加L2正则:
from keras import regularizer model.add(layers.Dense(..., kernel_regularizer = regularizers(0.001),...))
在某一层之后添加dropout层:
model.add(layers.Dropout(0.5))
原文地址:https://www.cnblogs.com/rising-sun/p/11625963.html
时间: 2024-11-10 08:59:26
在某一层添加L2正则:
from keras import regularizer model.add(layers.Dense(..., kernel_regularizer = regularizers(0.001),...))
在某一层之后添加dropout层:
model.add(layers.Dropout(0.5))
原文地址:https://www.cnblogs.com/rising-sun/p/11625963.html