Skip to contents

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

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

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

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

Usage

regularizer_l2(l2 = 0.01)

Arguments

l2

float, L2 regularization factor.

Value

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