Documentation ¶
Overview ¶
Package norm provides normalization and norm metric computations e.g., L2 = sqrt of sum of squares of a vector.
DivNorm does divisive normalization of elements SubNorm does subtractive normalization of elements ZScore subtracts the mean and divides by the standard deviation
Index ¶
- Variables
- func Abs32(a []float32)
- func Abs64(a []float64)
- func AddVec32(a []float32, val float32)
- func AddVec64(a []float64, val float64)
- func Binarize32(a []float32, thr, hiVal, loVal float32)
- func Binarize64(a []float64, thr, hiVal, loVal float64)
- func DivNorm32(a []float32, nfunc Func32)
- func DivNorm64(a []float64, nfunc Func64)
- func L132(a []float32) float32
- func L164(a []float64) float64
- func L232(a []float32) float32
- func L264(a []float64) float64
- func Max32(a []float32) float32
- func Max64(a []float64) float64
- func MaxAbs32(a []float32) float32
- func MaxAbs64(a []float64) float64
- func MaxIdx32(a []float32) (float32, int)
- func MaxIdx64(a []float64) (float64, int)
- func Mean32(a []float32) float32
- func Mean64(a []float64) float64
- func Min32(a []float32) float32
- func Min64(a []float64) float64
- func MinAbs32(a []float32) float32
- func MinAbs64(a []float64) float64
- func MinIdx32(a []float32) (float32, int)
- func MinIdx64(a []float64) (float64, int)
- func MultVec32(a []float32, val float32)
- func MultVec64(a []float64, val float64)
- func N32(a []float32) float32
- func N64(a []float64) float64
- func Std32(a []float32) float32
- func Std64(a []float64) float64
- func SubNorm32(a []float32, nfunc Func32)
- func SubNorm64(a []float64, nfunc Func64)
- func Sum32(a []float32) float32
- func Sum64(a []float64) float64
- func SumSquares32(a []float32) float32
- func SumSquares64(a []float64) float64
- func TensorAbs32(a *etensor.Float32)
- func TensorAbs64(a *etensor.Float64)
- func TensorDivNorm32(tsr *etensor.Float32, ndim int, nfunc Func32)
- func TensorDivNorm64(tsr *etensor.Float64, ndim int, nfunc Func64)
- func TensorSubNorm32(tsr *etensor.Float32, ndim int, nfunc Func32)
- func TensorSubNorm64(tsr *etensor.Float64, ndim int, nfunc Func64)
- func TensorUnit32(tsr *etensor.Float32, ndim int)
- func TensorUnit64(tsr *etensor.Float64, ndim int)
- func TensorZScore32(tsr *etensor.Float32, ndim int)
- func TensorZScore64(tsr *etensor.Float64, ndim int)
- func Thresh32(a []float32, hi bool, hiThr float32, lo bool, loThr float32)
- func Thresh64(a []float64, hi bool, hiThr float64, lo bool, loThr float64)
- func Unit32(a []float32)
- func Unit64(a []float64)
- func Var32(a []float32) float32
- func Var64(a []float64) float64
- func ZScore32(a []float32)
- func ZScore64(a []float64)
- type Func32
- type Func64
- type StdNorms
Constants ¶
This section is empty.
Variables ¶
var KiT_StdNorms = kit.Enums.AddEnum(StdNormsN, kit.NotBitFlag, nil)
Functions ¶
func Abs32 ¶ added in v1.1.8
func Abs32(a []float32)
Abs32 applies the Abs function to each element in given slice
func Abs64 ¶ added in v1.1.8
func Abs64(a []float64)
Abs64 applies the Abs function to each element in given slice
func Binarize32 ¶
Binarize32 turns vector into binary-valued, by setting anything >= the threshold to the high value, and everything below to the low value.
func Binarize64 ¶
Binarize64 turns vector into binary-valued, by setting anything >= the threshold to the high value, and everything below to the low value.
func DivNorm32 ¶
DivNorm32 does divisive normalization by given norm function i.e., it divides each element by the norm value computed from nfunc.
func DivNorm64 ¶
DivNorm64 does divisive normalization by given norm function i.e., it divides each element by the norm value computed from nfunc.
func L232 ¶
L232 computes the square-root of sum-of-squares of vector, i.e., the L2 norm. Skips NaN's. Uses optimized algorithm from BLAS that avoids numerical overflow.
func L264 ¶
L264 computes the square-root of sum-of-squares of vector, i.e., the L2 norm. Skips NaN's. Uses optimized algorithm from BLAS that avoids numerical overflow.
func MaxIdx32 ¶
MaxIdx32 computes the max over vector values, and returns index of max as well Skips NaN's
func MaxIdx64 ¶
MaxIdx64 computes the max over vector values, and returns index of max as well Skips NaN's
func MinIdx32 ¶
MinIdx32 computes the min over vector values, and returns index of min as well Skips NaN's
func MinIdx64 ¶
MinIdx64 computes the min over vector values, and returns index of min as well Skips NaN's
func SubNorm32 ¶
SubNorm32 does subtractive normalization by given norm function i.e., it subtracts norm computed by given function from each element.
func SubNorm64 ¶
SubNorm64 does subtractive normalization by given norm function i.e., it subtracts norm computed by given function from each element.
func SumSquares32 ¶
SumSquares32 computes the sum-of-squares of vector. Skips NaN's. Uses optimized algorithm from BLAS that avoids numerical overflow.
func SumSquares64 ¶
SumSquares64 computes the sum-of-squares of vector. Skips NaN's. Uses optimized algorithm from BLAS that avoids numerical overflow.
func TensorAbs32 ¶ added in v1.1.8
TensorAbs32 applies the Abs function to each element in given tensor
func TensorAbs64 ¶ added in v1.1.8
TensorAbs64 applies the Abs function to each element in given tensor
func TensorDivNorm32 ¶
TensorDivNorm32 does divisive normalization by given norm function computed on the first ndim dims of the tensor, where 0 = all values, 1 = norm each of the sub-dimensions under the first outer-most dimension etc. ndim must be < NumDims() if not 0.
func TensorDivNorm64 ¶
TensorDivNorm64 does divisive normalization by given norm function computed on the first ndim dims of the tensor, where 0 = all values, 1 = norm each of the sub-dimensions under the first outer-most dimension etc. ndim must be < NumDims() if not 0.
func TensorSubNorm32 ¶
TensorSubNorm32 does subtractive normalization by given norm function computed on the first ndim dims of the tensor, where 0 = all values, 1 = norm each of the sub-dimensions under the first outer-most dimension etc. ndim must be < NumDims() if not 0 (panics).
func TensorSubNorm64 ¶
TensorSubNorm64 does subtractive normalization by given norm function computed on the first ndim dims of the tensor, where 0 = all values, 1 = norm each of the sub-dimensions under the first outer-most dimension etc. ndim must be < NumDims() if not 0.
func TensorUnit32 ¶
TensorUnit32 subtracts the min and divides by the max, so that values are in 0-1 unit range computed on the first ndim dims of the tensor, where 0 = all values, 1 = norm each of the sub-dimensions under the first outer-most dimension etc. ndim must be < NumDims() if not 0 (panics).
func TensorUnit64 ¶
TensorUnit64 subtracts the min and divides by the max, so that values are in 0-1 unit range computed on the first ndim dims of the tensor, where 0 = all values, 1 = norm each of the sub-dimensions under the first outer-most dimension etc. ndim must be < NumDims() if not 0 (panics).
func TensorZScore32 ¶
TensorZScore32 subtracts the mean and divides by the standard deviation computed on the first ndim dims of the tensor, where 0 = all values, 1 = norm each of the sub-dimensions under the first outer-most dimension etc. ndim must be < NumDims() if not 0 (panics).
func TensorZScore64 ¶
TensorZScore64 subtracts the mean and divides by the standard deviation computed on the first ndim dims of the tensor, where 0 = all values, 1 = norm each of the sub-dimensions under the first outer-most dimension etc. ndim must be < NumDims() if not 0 (panics).
func Thresh32 ¶
Thresh32 thresholds the values of the vector -- anything above the high threshold is set to the high value, and everything below the low threshold is set to the low value.
func Thresh64 ¶
Thresh64 thresholds the values of the vector -- anything above the high threshold is set to the high value, and everything below the low threshold is set to the low value.
func Unit32 ¶
func Unit32(a []float32)
Unit32 subtracts the min and divides by the max, so that values are in 0-1 unit range
func Unit64 ¶
func Unit64(a []float64)
Unit64 subtracts the min and divides by the max, so that values are in 0-1 unit range
Types ¶
type StdNorms ¶
type StdNorms int
StdNorms are standard norm functions, including stats