Documentation ¶
Index ¶
- func AbsoluteError(a, b []float64) []float64
- func Accuracy(data []metrics) float64
- func Bhattacharyya(p, q []float64) float64
- func BoundingBoxIntersectionOverUnion(boxA, boxB *dlframework.BoundingBox) float64
- func BoundingBoxJaccard(boxA, boxB *dlframework.BoundingBox) float64
- func Broadcast(a float64, len int) []float64
- func CDF(data, edges []float64) (values []float64)
- func ClassificationTop1(features *dlframework.Features, expectedLabelIndex int) bool
- func ClassificationTop5(features *dlframework.Features, expectedLabelIndex int) bool
- func Correlation(x, y, weights []float64) float64
- func Covariance(x, y, weights []float64) float64
- func Edges(data ...[]float64) []float64
- func Expectation(data []float64) float64
- func F1Score(data []metrics) float64
- func Fpr(data []metrics) float64
- func Hellinger(p, q []float64) float64
- func Histogram(data []float64, edges []float64) (bins []uint, total uint)
- func IntersectionOverUnion(featA, featB *dlframework.Feature) float64
- func Jaccard(featA, featB *dlframework.Feature) float64
- func JensenShannon(p, q []float64) float64
- func KolmogorovSmirnov(data1, data2 []float64) float64
- func KullbackLeibler(p, q []float64) float64
- func L2(x, y []float64) float64
- func Mean(x []float64) float64
- func MeanSquaredError(a, b []float64) float64
- func MeanSquaredPercentageError(y, yhat []float64) float64
- func NormalizedRootMeanSquaredError(y, yhat []float64) float64
- func PDF(data, edges []float64) (values []float64)
- func PeakSignalToNoiseRatio(input, reference []float64) float64
- func Precision(data []metrics) float64
- func Recall(data []metrics) float64
- func RegisterFeatureCompareFunction(name string, f FeatureCompareFunction)
- func RelativeAbsoluteError(a, b []float64) float64
- func RootMeanSquaredError(y, yhat []float64) float64
- func RootMeanSquaredPercentageError(y, yhat []float64) float64
- func SquaredError(a, b []float64) []float64
- func SquaredLogError(a, b []float64) []float64
- func Sum(s []float64) float64
- func Top1(features *dlframework.Features, expectedLabelIndex int) bool
- func Top5(features *dlframework.Features, expectedLabelIndex int) bool
- func Uniform(x, y []float64) float64
- func Variance(data []float64) float64
- func WeightedMean(x, weights []float64) float64
- type FeatureCompareFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsoluteError ¶
Compute the absolute error This function computes the elementwise absolute error for a vector
func Bhattacharyya ¶
Bhattacharyya computes the distance between the probability distributions p and q given by:
-\ln ( \sum_i \sqrt{p_i q_i} )
The lengths of p and q must be equal. It is assumed that p and q sum to 1.
func BoundingBoxIntersectionOverUnion ¶
func BoundingBoxIntersectionOverUnion(boxA, boxB *dlframework.BoundingBox) float64
https://stackoverflow.com/questions/28723670/intersection-over-union-between-two-detections https://resources.wolframcloud.com/NeuralNetRepository/resources/SSD-VGG-300-Trained-on-PASCAL-VOC-Data
func BoundingBoxJaccard ¶
func BoundingBoxJaccard(boxA, boxB *dlframework.BoundingBox) float64
func CDF ¶
CDF calculates an empirical cumulative distribution function. The granularity of the function is specified by a set of edges; see Histogram.
func ClassificationTop1 ¶
func ClassificationTop1(features *dlframework.Features, expectedLabelIndex int) bool
ClassificationTop1 ...
func ClassificationTop5 ¶
func ClassificationTop5(features *dlframework.Features, expectedLabelIndex int) bool
ClassificationTop5 ...
func Correlation ¶
Correlation returns the weighted correlation between the samples of x and y with the given WeightedMeans.
sum_i {w_i (x_i - WeightedMeanX) * (y_i - WeightedMeanY)} / (stdX * stdY)
The lengths of x and y must be equal. If weights is nil then all of the weights are 1. If weights is not nil, then len(x) must equal len(weights).
func Covariance ¶
Covariance returns the weighted covariance between the samples of x and y.
sum_i {w_i (x_i - WeightedMeanX) * (y_i - WeightedMeanY)} / (sum_j {w_j} - 1)
The lengths of x and y must be equal. If weights is nil then all of the weights are 1. If weights is not nil, then len(x) must equal len(weights).
func Edges ¶
Edges returns sorted unique elements of a number of data sets, ensuring that the first and last elements are -∞ and +∞, respectively.
func Expectation ¶
Expectation computes an estimate of the population mean from a finite sample.
func F1Score ¶
func F1Score(data []metrics) float64
F1Score = 2 * [(precision*recall) / (precision + recall)]
func Fpr ¶
func Fpr(data []metrics) float64
FPR = FP / non-monitored elements = (FPP + FNP) / (TN + FNP)
func Hellinger ¶
Hellinger computes the distance between the probability distributions p and q given by:
\sqrt{ 1 - \sum_i \sqrt{p_i q_i} }
The lengths of p and q must be equal. It is assumed that p and q sum to 1.
func Histogram ¶
Histogram counts the number of points that fall into each of the bins specified by a set of edges. For n edges, the number of bins is (n-1). The left endpoint of a bin is assumed to belong to the bin while the right one is assumed to do not.
func IntersectionOverUnion ¶
func IntersectionOverUnion(featA, featB *dlframework.Feature) float64
func Jaccard ¶
func Jaccard(featA, featB *dlframework.Feature) float64
func JensenShannon ¶
JensenShannon computes the JensenShannon divergence between the distributions p and q. The Jensen-Shannon divergence is defined as
m = 0.5 * (p + q) JS(p, q) = 0.5 ( KL(p, m) + KL(q, m) )
Unlike Kullback-Liebler, the Jensen-Shannon distance is symmetric. The value is between 0 and ln(2).
func KolmogorovSmirnov ¶
KolmogorovSmirnov computes the Kolmogorov–Smirnov statistic for two samples.
https://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test
func KullbackLeibler ¶
KullbackLeibler computes the Kullback-Leibler distance between the distributions p and q. The natural logarithm is used.
sum_i(p_i * log(p_i / q_i))
Note that the Kullback-Leibler distance is not symmetric; KullbackLeibler(p,q) != KullbackLeibler(q,p)
func MeanSquaredError ¶
func MeanSquaredPercentageError ¶
MSPE computes the mean-square-percentage error.
func NormalizedRootMeanSquaredError ¶
NRMSE computes the normalized root-mean-square error.
https://en.wikipedia.org/wiki/Root-mean-square_deviation#Normalized_root-mean-square_deviation
func PDF ¶
PDF calculates an empirical probability density function. The granularity of the function is specified by a set of edges; see Histogram.
func PeakSignalToNoiseRatio ¶
Suppose pixel values in [0,1] refer https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio
func RegisterFeatureCompareFunction ¶
func RegisterFeatureCompareFunction(name string, f FeatureCompareFunction)
func RelativeAbsoluteError ¶
func RootMeanSquaredError ¶
RMSE computes the root-mean-square error.
func RootMeanSquaredPercentageError ¶
RMSPE computes the root-mean-square-percentage error.
func SquaredError ¶
Compute the squared error This function computes the elementwise squared error for a vector
func SquaredLogError ¶
Compute the squared log error This function computes the elementwise squared log error for a vector
func Variance ¶
Variance computes an estimate of the population variance from a finite sample. The estimate is unbiased. The computation is based on the compensated-summation version of the two-pass algorithm.
https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Two-pass_algorithm
func WeightedMean ¶
WeightedMean computes the weighted WeightedMean of the data set.
sum_i {w_i * x_i} / sum_i {w_i}
If weights is nil then all of the weights are 1. If weights is not nil, then len(x) must equal len(weights).
Types ¶
type FeatureCompareFunction ¶
type FeatureCompareFunction func(actual *dlframework.Features, expected interface{}) float64
func GetFeatureCompareFunction ¶
func GetFeatureCompareFunction(name string) FeatureCompareFunction