It is not possible to directly apply the βglobalβ weight loss directly to the entire keras model.
However, as I describe here , you can use weight reduction for a model by looking at its layers and manually applying regularizers to the corresponding layers. Here is the relevant code snippet:
model = keras.applications.ResNet50(include_top=True, weights='imagenet') alpha = 0.00002
source share