Documentation
¶
Overview ¶
Package dnnmath provides float32 activation, exponent, quantization, and small-vector kernels used by the optional DRED, OSCE, and LPCNet networks. The scalar build follows libopus's generic kernels; the Go SIMD build selects target-specific kernels where available. Compare each path with the matching libopus build and dispatch.
Index ¶
- Constants
- func CGEMV8x4X86([]float32, dnnblob.Int8View, dnnblob.Float32View, int, int, []float32, []uint8)
- func CeltLog(x float32) float32
- func CeltSin(x float32) float32
- func Cgemv8x4QuantizeInput(x float32) int8
- func Cgemv8x4QuantizeInputScalar(x float32) int8
- func Conv2D3x3X86([]float32, dnnblob.Float32View, int, int, []float32, int, int)
- func Exp2Approx(x float32) float32
- func ExpApprox(x float32) float32
- func ExpVectorApprox(out, in []float32, n int)
- func ExpVectorScalarApprox(out, in []float32, n int)
- func SGEMVX86([]float32, dnnblob.Float32View, int, int, int, []float32)
- func SigmoidScalarApprox(x float32) float32
- func SigmoidVectorApprox(out, in []float32, n int)
- func SigmoidVectorScalarApprox(out, in []float32, n int)
- func SoftmaxApprox(out, in []float32, n int)
- func SparseCGEMV8x4X86([]float32, dnnblob.Int8View, dnnblob.Int32View, dnnblob.Float32View, int, int, ...)
- func SparseSGEMV8x4X86([]float32, dnnblob.Float32View, dnnblob.Int32View, int, []float32)
- func TanhApprox(x float32) float32
- func TanhScalarApprox(x float32) float32
- func TanhVectorApprox(out, in []float32, n int)
- func TanhVectorScalarApprox(out, in []float32, n int)
Constants ¶
const X86VectorKernels = false
X86VectorKernels is false outside the amd64 Go SIMD lane.
Variables ¶
This section is empty.
Functions ¶
func CGEMV8x4X86 ¶ added in v0.2.0
func CeltLog ¶
CeltLog mirrors libopus' floating-point celt_log() macro when FLOAT_APPROX is enabled in the reference build.
func Cgemv8x4QuantizeInput ¶
Cgemv8x4QuantizeInput mirrors libopus' ARM NEON quantizer, which uses nearest-even conversion after a float32 multiply. Other scalar callers use floor(0.5 + 127*x); the x86 SIMD kernels quantize inside CGEMV8x4X86.
func Cgemv8x4QuantizeInputScalar ¶
Cgemv8x4QuantizeInputScalar mirrors libopus' generic cgemv8x4 input quantizer.
func Conv2D3x3X86 ¶ added in v0.2.0
func Exp2Approx ¶
Exp2Approx mirrors libopus' DNN lpcnet_exp2() cubic approximation.
func ExpVectorApprox ¶
ExpVectorApprox mirrors libopus' active vector exponent kernel. In libopus this helper is named softmax(), and ACTIVATION_EXP uses it without the normalisation step.
func ExpVectorScalarApprox ¶
ExpVectorScalarApprox mirrors libopus' generic DNN exponent kernel.
func SigmoidScalarApprox ¶
SigmoidScalarApprox mirrors libopus' generic DNN sigmoid path.
func SigmoidVectorApprox ¶
SigmoidVectorApprox mirrors libopus' active vector sigmoid helper, including the NEON tail path used when N is not a multiple of four.
func SigmoidVectorScalarApprox ¶
SigmoidVectorScalarApprox mirrors libopus' generic DNN sigmoid helper.
func SoftmaxApprox ¶
SoftmaxApprox mirrors libopus' pinned ACTIVATION_SOFTMAX path. The 1.6.1 nnet.c build defines SOFTMAX_HACK, so softmax activations copy inputs unchanged. ACTIVATION_EXP still uses ExpVectorApprox's exponent kernel.
func SparseCGEMV8x4X86 ¶ added in v0.2.0
func SparseSGEMV8x4X86 ¶ added in v0.2.0
func TanhApprox ¶
TanhApprox mirrors libopus' DNN ACTIVATION_TANH path.
func TanhScalarApprox ¶
TanhScalarApprox mirrors libopus' generic DNN tanh path.
func TanhVectorApprox ¶
TanhVectorApprox mirrors libopus' active vector tanh helper, including the NEON tail path used when N is not a multiple of four.
func TanhVectorScalarApprox ¶
TanhVectorScalarApprox mirrors libopus' generic DNN tanh helper.
Types ¶
This section is empty.