Skip to main content

The pure-Python core

omnibias-core is the single source of truth for the math. It contains no torch / jax / tensorflow / keras imports, which is what makes the backends bit-identical and the verified substrate backend-free.

What lives here

ModuleResponsibility
omnibias.core.polynomialscoefficient generators: sigmoid_polynomial_coeffs, tanh_polynomial_coeffs, hermite_coeffs
omnibias.core.bellBell polynomials / Faà di Bruno combinatorics
omnibias.core.specthe ActivationSpec dataclass (metadata shared by all backends)
omnibias.core.multi_indexmulti-index ordering + Cauchy-product table for multivariate jets
omnibias.core.verifiedinterval / affine / Taylor-model arithmetic and validated numerics
omnibias.core.proofthe hash-sealed certificate format and the Lean bridge

The derivative-tower contract

This is the contract every backend honors:

  • All polynomial coefficients come from omnibias.core.polynomials. Backends import them; they do not reimplement them.
  • An activation is described by an ActivationSpec. Backends specialize the tensor type but share the metadata.
  • A fast-path kernel computes σⁿ(z) directly. For n < 0 it raises ValueError; genuinely unimplemented orders raise NotImplementedError.
  • OperatorBlock dispatches on the op tag: identity | grad | laplacian | derivative | band | integral.
from omnibias.core import ActivationSpec
from omnibias.core.polynomials import tanh_polynomial_coeffs

coeffs = tanh_polynomial_coeffs(5) # exact rational/integer coefficients

Why pure Python?

A single definition means:

  • Bit-identical backends — the same coefficients produce the same bits.
  • A backend-free verified register — interval and Taylor-model arithmetic can use the exact same coefficients without depending on torch or jax.
  • Auditability — the math is small, pure, and readable in one place.

The ActivationSpec

ActivationSpec(
name="tanh",
forward=..., # σ(z)
derivative=..., # σ'(z) if known
fastpath=..., # σⁿ(z) for supported orders
riccati_polynomial=..., # P with σ'(z) = P(σ(z)), or None
noise_model="...", # GLM family whose log-partition is σ, or "none"
operator_role="...", # role of the K=2 bias-collapse unit
)

Backends wrap this with their tensor type but never change its meaning.

Continue