nnmnkwii.metrics.mean_squared_error

nnmnkwii.metrics.mean_squared_error(X, Y, lengths=None)[source]

Mean squared error (MSE).

Parameters
  • X (ndarray) – Input features, shape can be either of (D,), (T x D) or (B x T x D). Both Numpy and torch arrays are supported.

  • Y (ndarray) – Target features, shape can be either of (D,), (T x D) or (B x T x D). Both Numpy and torch arrays are supported.

  • lengths (list) – Lengths of padded inputs. This should only be specified if you give mini-batch inputs.

Returns

Mean squared error.

Return type

float

Tip

The function supports 3D padded inputs, while sklearn.metrics.mean_squared_error() doesn’t support.