L1

class L1(value: Float) : L2L1

A regularizer that applies a L1 regularization penalty.

The L1 regularization penalty is computed as:

``loss = l1 * reduceSum(abs(x))``

Constructors

L1
Link copied to clipboard
fun L1(value: Float = DEFAULT_PENALTY)

Functions

apply
Link copied to clipboard
open override fun apply(tf: Ops, input: Operand<Float>): Operand<Float>

Applies regularization to the input.

Properties

l1
Link copied to clipboard
val l1: Float

Value of L1 regularization penalty. Could be calculated during graph computations.

l2
Link copied to clipboard
val l2: Float

Value of L2 regularization penalty. Could be calculated during graph computations.