l2_regularizer¶
-
tfsnippet.layers.l2_regularizer(lambda_, name=None)¶ Construct an L2 regularizer that computes the L2 regularization loss:
output = lambda_ * 0.5 * sum(input ** 2)
Parameters: - lambda – The coefficiency of L2 regularizer.
- name (str) – Default name of the name scope. If not specified, generate one according to the method name.
Returns: - A function that computes the L2
regularization term for input tensor.
Return type: (tf.Tensor) -> tf.Tensor