rmse#

diffsptk.RMSE#

alias of RootMeanSquareError

class diffsptk.RootMeanSquareError(reduction='mean', eps=1e-08)[source]#

See this page for details.

Parameters:
reduction[‘none’, ‘mean’, ‘sum’]

Reduction type.

epsfloat >= 0

A small value to prevent NaN.

forward(x, y)[source]#

Calculate RMSE.

Parameters:
xTensor [shape=(…, T)]

Input.

yTensor [shape=(…, T)]

Target.

Returns:
outTensor [shape=(…,) or scalar]

RMSE.

Examples

>>> x = diffsptk.nrand(4)
>>> x
tensor([-0.5945, -0.2401,  0.8633, -0.6464,  0.4515])
>>> y = diffsptk.nrand(4)
>>> y
tensor([-0.4025,  0.9367,  1.1299,  3.1986, -0.2832])
>>> rmse = diffsptk.RootMeanSquaredError()
>>> e = rmse(x, y)
>>> e
tensor(1.8340)
diffsptk.functional.rmse(x, y, reduction='mean', eps=1e-08)[source]#

Calculate RMSE.

Parameters:
xTensor [shape=(…, T)]

Input.

yTensor [shape=(…, T)]

Target.

reduction[‘none’, ‘mean’, ‘sum’]

Reduction type.

epsfloat >= 0

A small value to prevent NaN.

Returns:
outTensor [shape=(…,) or scalar]

RMSE.

See also

snr