dnnmath

package
v0.2.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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 CGEMV8x4X86([]float32, dnnblob.Int8View, dnnblob.Float32View, int, int, []float32, []uint8)

func CeltLog

func CeltLog(x float32) float32

CeltLog mirrors libopus' floating-point celt_log() macro when FLOAT_APPROX is enabled in the reference build.

func CeltSin

func CeltSin(x float32) float32

CeltSin mirrors libopus' floating-point celt_sin() macro.

func Cgemv8x4QuantizeInput

func Cgemv8x4QuantizeInput(x float32) int8

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

func Cgemv8x4QuantizeInputScalar(x float32) int8

Cgemv8x4QuantizeInputScalar mirrors libopus' generic cgemv8x4 input quantizer.

func Conv2D3x3X86 added in v0.2.0

func Conv2D3x3X86([]float32, dnnblob.Float32View, int, int, []float32, int, int)

func Exp2Approx

func Exp2Approx(x float32) float32

Exp2Approx mirrors libopus' DNN lpcnet_exp2() cubic approximation.

func ExpApprox

func ExpApprox(x float32) float32

ExpApprox mirrors libopus' DNN lpcnet_exp() helper used by ACTIVATION_EXP.

func ExpVectorApprox

func ExpVectorApprox(out, in []float32, n int)

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

func ExpVectorScalarApprox(out, in []float32, n int)

ExpVectorScalarApprox mirrors libopus' generic DNN exponent kernel.

func SGEMVX86 added in v0.2.0

func SGEMVX86([]float32, dnnblob.Float32View, int, int, int, []float32)

func SigmoidScalarApprox

func SigmoidScalarApprox(x float32) float32

SigmoidScalarApprox mirrors libopus' generic DNN sigmoid path.

func SigmoidVectorApprox

func SigmoidVectorApprox(out, in []float32, n int)

SigmoidVectorApprox mirrors libopus' active vector sigmoid helper, including the NEON tail path used when N is not a multiple of four.

func SigmoidVectorScalarApprox

func SigmoidVectorScalarApprox(out, in []float32, n int)

SigmoidVectorScalarApprox mirrors libopus' generic DNN sigmoid helper.

func SoftmaxApprox

func SoftmaxApprox(out, in []float32, n int)

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 SparseSGEMV8x4X86([]float32, dnnblob.Float32View, dnnblob.Int32View, int, []float32)

func TanhApprox

func TanhApprox(x float32) float32

TanhApprox mirrors libopus' DNN ACTIVATION_TANH path.

func TanhScalarApprox

func TanhScalarApprox(x float32) float32

TanhScalarApprox mirrors libopus' generic DNN tanh path.

func TanhVectorApprox

func TanhVectorApprox(out, in []float32, n int)

TanhVectorApprox mirrors libopus' active vector tanh helper, including the NEON tail path used when N is not a multiple of four.

func TanhVectorScalarApprox

func TanhVectorScalarApprox(out, in []float32, n int)

TanhVectorScalarApprox mirrors libopus' generic DNN tanh helper.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL