Missed TensorFlow Dev Summit? Check out the video playlist.

tf.keras.regularizers.l2

Create a regularizer that applies an L2 regularization penalty.

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

Used in the notebooks

Used in the guide Used in the tutorials

The L2 regularization penalty is computed as:

$$\ell_2\,\,penalty =\ell_2\sum_{i=0}^nx_i^2$$

Arguments:

• l: Float; L2 regularization factor.

Returns:

An L2 Regularizer with the given regularization factor.