Skip to main content

ClikaRT::ops::mse_loss

function

mse_loss()

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

Mean-squared-error loss between input and target.

i=(xiyi)2\ell_i = (x_i - y_i)^2

Reduction::None returns the per-element losses (shape of input); Mean / Sum reduce to a 0-D scalar.

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 2999