TensorFlow

API

 tf.keras / regularizers / regularizers.l1


Create a regularizer that applies both L1 and L2 penalties.

Used in the notebooks

Used in the tutorials

The L1 regularization penalty is computed as: loss = l1 * reduce_sum(abs(x))

The L2 regularization penalty is computed as: loss = l2 * reduce_sum(square(x))

l1 Float; L1 regularization factor.
l2 Float; L2 regularization factor.

An L1L2 Regularizer with the given regularization factors.

此页内容是否对您有帮助