L2

class L2(value: Float) : L2L1

A regularizer that applies a L2 regularization penalty.

The L2 regularization penalty is computed as:

``loss = l2 * reduce_sum(square(x))``

Constructors

L2
Link copied to clipboard
fun L2(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.