在某一层添加L2正则:
from keras import regularizer model.add(layers.Dense(..., kernel_regularizer = regularizers(0.001),...))
在某一层之后添加dropout层:
model.add(layers.Dropout(0.5))
2024-03-27 20:58:04
在某一层添加L2正则:
from keras import regularizer model.add(layers.Dense(..., kernel_regularizer = regularizers(0.001),...))
在某一层之后添加dropout层:
model.add(layers.Dropout(0.5))