Regularizers allow to apply penalties on network parameters during optimization.
The keyword arguments used for passing penalties to parameters in a layer will depend on the layer.
In the Dense
layer it is simply W_regularizer
for the main weights matrix, and b_regularizer
for the bias.
from keras.regularizers import l2
model.add(Dense(64, 64, W_regularizer = l2(.01)))