Skip to main content

omnibias.keras

0.0.2a1AlphaPython >=3.10Apache-2.0

Keras 3 operator layers and activation paths implemented with keras.ops for TensorFlow, JAX, or Torch.

import omnibias.keras

Use the Keras distribution when your model lifecycle, layer configuration, and serialization are managed by Keras 3. Set KERAS_BACKEND before importing Keras or omnibias.keras; switching that variable after initialization does not reinitialize the backend. Install a compatible numerical backend alongside this alpha distribution.

Layer input and output dimensions, operator order, and build-time state are part of the individual layer contract. A layer's configurable operator is not evidence that every activation, order, dtype, or backend path is supported. Verify the combination you will train. Configuration round trips and numerical equality are separate checks.

The downloadable Keras example runs OMBU on a complete input batch, checks the output shape and finite values, and reconstructs the layer from its configuration. It is validated separately on TensorFlow, JAX, and Torch. More specialized APIs need their own path-specific validation; this example is not a blanket backend-parity certificate.

Module contract & mathematical conventions

omnibias.keras: Keras 3 unified backend for omnibias.

The same code runs on TensorFlow, JAX, or PyTorch because every kernel is written against keras.ops. Closed-form n-th derivative towers (sigma^(n)(z)) share their polynomial coefficients with the torch and JAX backends via omnibias.core.polynomials, so the closed-form activation / derivative math is algebraically corresponding across backends by construction. End-to-end layer numerics otherwise follow the selected Keras backend (TensorFlow / JAX / PyTorch).

Select the Keras backend with the KERAS_BACKEND environment variable (tensorflow | jax | torch) *before* importing keras.

Public API:

  • OperatorMultiBiasUnit (alias OMBU): trainable scalar-operator primitive (a keras.layers.Layer).
  • GrowableOperatorMultiBiasUnit (alias GrowableOMBU): the OMBU with a growable bias arity K.
  • OperatorBlock: typed wrapper selecting K and forward behaviour from op="grad"|"laplacian"|"derivative"|"band"|"integral"|"identity".
  • cmbDense, cmbConv1D, cmbConv2D: drop-in Dense / Conv1D / Conv2D with an inline OperatorBlock.
  • KGrowthScheduler: plateau-triggered K-growth controller.
  • get_activation, list_activations, register_activation, is_registered: registry accessors.

Numerical scope: shared coefficients and formulas do not establish universal floating-point identity across backends, devices, compiler transforms, or reduction orders. Compare the chosen path with dtype-appropriate tolerances; even float64 is not a general bitwise-equality guarantee. Algebraic initialization identities likewise need a numerical check for the selected coefficients and reduction order.

Shared formulas do not imply universal floating-point identity. Verify dtype, shape, derivative-order support, and the stated numerical assumptions for the path you use.

Imports & aliases​

These names share a definition with another public module. Follow a name for its full contract, parameters, and examples.

Import from this moduleCanonical reference
ActivationSpecomnibias.core.ActivationSpec
AnalyticGaussianConv1Domnibias.keras.AnalyticGaussianConv1D
AnalyticGaussianConv2Domnibias.keras.AnalyticGaussianConv2D
GrowStrategyomnibias.keras.GrowStrategy
GrowableOMBUomnibias.keras.GrowableOMBU
GrowableOperatorMultiBiasUnitomnibias.keras.GrowableOMBU
KGrowthScheduleromnibias.keras.KGrowthScheduler
LearnablePReLUomnibias.keras.LearnablePReLU
OMBUomnibias.keras.OMBU
OpNameomnibias.keras.OpName
OperatorBlockomnibias.keras.OperatorBlock
OperatorMultiBiasUnitomnibias.keras.OMBU
TemperedActivationomnibias.keras.TemperedActivation
analytic_gaussian_tapsomnibias.keras.analytic_gaussian_taps
cmbConv1Domnibias.keras.cmbConv1D
cmbConv2Domnibias.keras.cmbConv2D
cmbDenseomnibias.keras.cmbDense
get_activationomnibias.keras.get_activation
is_registeredomnibias.keras.is_registered
list_activationsomnibias.keras.list_activations
register_activationomnibias.keras.register_activation