Fork me on GitHub
Arraymancer Technical reference Tutorial Spellbook (How-To's) Under the hood

Module common_error_functions

Procs

proc squared_error[T](y_true, y: T): T {.
inline
.}
Squared error for a single value, |y_true - y| ^2   Source Edit
proc squared_error[T](y_true, y: Tensor[T]): Tensor[T] {.
noInit
.}
Element-wise squared error for a tensor, |y_true - y| ^2   Source Edit
proc mean_squared_error[T](y_true, y: Tensor[T]): T
Also known as MSE or L2 loss, mean squared error between elements: sum(|y_true - y| ^2)/m where m is the number of elements   Source Edit
proc relative_error[T](y_true, y: T): T {.
inline
.}
Relative error, |y_true - y|/max(|y_true|, |y|) Normally the relative error is defined as |y_true - y| / |y_true|, but here max is used to make it symmetric and to prevent dividing by zero, guaranteed to return zero in the case when both values are zero.   Source Edit
proc relative_error[T](y_true, y: Tensor[T]): Tensor[T] {.
noInit
.}
Relative error for Tensor, element-wise |y_true - x|/max(|y_true|, |x|) Normally the relative error is defined as |y_true - x| / |y_true|, but here max is used to make it symmetric and to prevent dividing by zero, guaranteed to return zero in the case when both values are zero.   Source Edit
proc mean_relative_error[T](y_true, y: Tensor[T]): T
Mean relative error for Tensor, mean of the element-wise |y_true - y|/max(|y_true|, |y|) Normally the relative error is defined as |y_true - y| / |y_true|, but here max is used to make it symmetric and to prevent dividing by zero, guaranteed to return zero in the case when both values are zero.   Source Edit
proc absolute_error[T](y_true, y: T): T {.
inline
.}
Absolute error for a single value, |y_true - y|   Source Edit
proc absolute_error[T](y_true, y: Tensor[T]): Tensor[T] {.
noInit
.}
Element-wise absolute error for a tensor   Source Edit
proc mean_absolute_error[T](y_true, y: Tensor[T]): T
Also known as L1 loss, absolute error between elements: sum(|y_true - y|)/m where m is the number of elements   Source Edit