Skip to main content

ClikaRT::ops::l1_loss

function

l1_loss()

Tensor l1_loss(
    Tensor input,
    Tensor target,
    Reduction reduction = Reduction::Mean
)

Mean-absolute-error loss between input and target.

i=xiyi\ell_i = |x_i - y_i|

Parameters

  • input: predictions; float dtype.
  • target: ground truth; same shape as input.
  • reduction: None / Mean / Sum; default Mean.

Returns: the loss (0-D under Mean/Sum).

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) on an input/target shape mismatch.

Declared in ClikaRT/compute/ops.h, line 2984