nnmnkwii.metrics.lf0_mean_squared_error

nnmnkwii.metrics.lf0_mean_squared_error(src_f0, src_vuv, tgt_f0, tgt_vuv, lengths=None, linear_domain=False)[source]

Mean squared error (MSE) for log-F0 sequences.

MSE is computed for voiced segments.

Parameters
  • src_f0 (ndarray) – Input log-F0 sequences, shape can be either of (T,), (B x T) or (B x T x 1). Both Numpy and torch arrays are supported.

  • src_vuv (ndarray) – Input voiced/unvoiced flag array, shape can be either of (T, ), (B x T) or (B x T x 1).

  • tgt_f0 (ndarray) – Target log-F0 sequences, shape can be either of (T,), (B x T) or (B x T x 1). Both Numpy and torch arrays are supported.

  • tgt_vuv (ndarray) – Target voiced/unvoiced flag array, shape can be either of (T, ), (B x T) or (B x T x 1).

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

  • linear_domain (bool) – Whether computes MSE on linear frequecy domain or log-frequency domain.

Returns

mean squared error.

Return type

float