tf.keras.regularizers.l2

Create a regularizer that applies an L2 regularization penalty.

Compat aliases for migration

See Migration guide for more details.

tf.compat.v1.keras.regularizers.l2

The L2 regularization penalty is computed as:

2penalty=2i=0nxi2

l Float; L2 regularization factor.

An L2 Regularizer with the given regularization factor.