l2_loss¶
dragon.vm.tensorflow.nn.
l2_loss
(
t,
name=None
)[source]¶Compute the loss of element-wise squared error.
The L2Loss function is defined as:
\[\text{L2Loss}(t) = sum(0.5 * t^{2}) \]Examples:
t = tf.constant([-1., 2., -3.]) print(tf.nn.l2_loss(t)) # 7.0
- Parameters:
- t (dragon.Tensor) – The input tensor.
- name (str, optional) – The operation name.
- Returns:
dragon.Tensor – The output tensor.