regularizer_l1 {keras3}R Documentation

A regularizer that applies a L1 regularization penalty.

Description

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

L1 may be passed to a layer as a string identifier:

dense <- layer_dense(units = 3, kernel_regularizer = 'l1')

In this case, the default value used is l1=0.01.

Usage

regularizer_l1(l1 = 0.01)

Arguments

l1

float, L1 regularization factor.

Value

A Regularizer instance that can be passed to layer constructors or used as a standalone object.

See Also

Other regularizers:
regularizer_l1_l2()
regularizer_l2()
regularizer_orthogonal()


[Package keras3 version 1.1.0 Index]