Announcing the TensorFlow Dev Summit 2020 Learn more

tf.keras.regularizers.l1

TensorFlow 1 version View source on GitHub

Create a regularizer that applies an L1 regularization penalty.

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

Used in the guide:

The L1 regularization penalty is computed as:

\(\ell_1\,\,penalty =\ell_1\sum_{i=0}^n|x_i|\)

Arguments:

  • l: Float; L1 regularization factor.

Returns:

An L1 Regularizer with the given regularization factor.

Compat aliases