dnnmath

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 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 the activation, exponent and input-quantization kernels libopus' neural-network code (DRED, OSCE) relies on. Each kernel keeps a scalar path that mirrors the generic libopus build and, on arm64, a NEON path matching the SIMD reference so the DNN output is bit-exact per tier.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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' cgemv8x4 input quantizer for the active DNN vector path. ARM NEON uses nearest-even conversion after a float32 multiply; the scalar fallback uses floor(0.5 + 127*x).

func Cgemv8x4QuantizeInputScalar

func Cgemv8x4QuantizeInputScalar(x float32) int8

Cgemv8x4QuantizeInputScalar mirrors libopus' generic cgemv8x4 input quantizer.

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 SigmoidApprox

func SigmoidApprox(x float32) float32

SigmoidApprox mirrors libopus' DNN ACTIVATION_SIGMOID path.

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 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