tf.keras.regularizers.l2

View source on GitHub

Create a regularizer that applies an L2 regularization penalty.

tf.keras.regularizers.l2(
    l=0.01
)

The L2 regularization penalty is computed as: $$\ell_2\,\,penalty =\ell_2\sum_{i=0}nx_i2$$

Arguments:

Returns:

An L2 Regularizer with the given regularization factor.