Metadata-Version: 2.4
Name: omnibias-keras
Version: 0.0.1a1
Summary: Keras 3 unified backend for omnibias: closed-form n-th derivative scalar operators (OMBU), operator-typed blocks, and drop-in cmbDense / cmbConv layers that run on TensorFlow, JAX, or PyTorch via keras.ops.
Author-email: Vardan Grigoryants <vardan@derivon.ai>
Maintainer-email: Derivon <info@derivon.ai>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/derivon-ai/omnibias
Project-URL: Documentation, https://omnibias.ai/
Project-URL: Source, https://github.com/derivon-ai/omnibias
Project-URL: Issues, https://github.com/derivon-ai/omnibias/issues
Project-URL: Changelog, https://github.com/derivon-ai/omnibias/blob/main/CHANGELOG.md
Keywords: deep-learning,keras,tensorflow,jax,pytorch,activation-functions,operator-learning,closed-form-derivatives
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: omnibias-core>=0.2.0
Requires-Dist: keras>=3.0
Requires-Dist: numpy>=1.23
Provides-Extra: tf
Requires-Dist: tensorflow>=2.16; extra == "tf"
Provides-Extra: jax
Requires-Dist: jax>=0.4.30; extra == "jax"
Requires-Dist: jaxlib>=0.4.30; extra == "jax"
Provides-Extra: torch
Requires-Dist: torch>=2.0; extra == "torch"
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Requires-Dist: pytest-cov>=4.0; extra == "test"
Requires-Dist: numpy>=1.24; extra == "test"
Dynamic: license-file

# 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`. The closed-form n-th derivative towers
(`sigma^(n)(z)`) use the *same* polynomial coefficients as
`omnibias-torch` and `omnibias-jax` — they are imported from the shared
pure-Python `omnibias.core.polynomials`, so the closed-form activation /
derivative math is **bit-identical across backends by construction**.
End-to-end layer numerics otherwise follow the selected Keras backend.

## Install

```bash
pip install omnibias-keras[jax]         # or [tf] / [torch]
```

Select the Keras backend *before importing keras*:

```bash
export KERAS_BACKEND=jax                 # tensorflow | jax | torch
```

or in Python:

```python
import os
os.environ["KERAS_BACKEND"] = "jax"
import keras  # noqa: E402
```

## Quickstart

```python
import keras
from omnibias.keras import OMBU, OperatorBlock, cmbDense

# Trainable K-bias scalar operator (drop-in for an activation).
ombu = OMBU(num_channels=4, K=2, base="tanh")
y = ombu(keras.ops.zeros((8, 4)))

# Typed operator: closed-form 2nd derivative of the base activation.
lap = OperatorBlock(channels=4, op="laplacian", base="gaussian")

# Dense + inline operator, a drop-in for keras.layers.Dense.
model = keras.Sequential([
    keras.layers.Input(shape=(4,)),
    cmbDense(units=64, op="identity", base="tanh"),
    cmbDense(units=1, op="identity", base="tanh"),
])
```

## Public API

| Symbol | Role |
|---|---|
| `OperatorMultiBiasUnit` (`OMBU`) | trainable K-bias scalar operator |
| `GrowableOperatorMultiBiasUnit` (`GrowableOMBU`) | OMBU with a growable K |
| `OperatorBlock` | typed wrapper: `identity / grad / laplacian / derivative / band / integral` |
| `cmbDense`, `cmbConv1D`, `cmbConv2D` | drop-in `Dense` / `Conv1D` / `Conv2D` with an inline operator |
| `KGrowthScheduler` | plateau-triggered K-growth controller |
| `get_activation`, `list_activations`, `register_activation`, `is_registered` | activation registry |

## Activation dictionary

Same names as the other backends: `sigmoid`, `tanh`, `softplus`,
`gaussian`, `exp`, `relu`, `silu`, `gelu`, `huber`, `arctan`, `log1pu2`,
`sin`, `cos`, `sinh`, `cosh`, `tan`, `cot`, `coth`, `sech`, `log_cosh`,
`softabs`, `smooth_sign`, `mish`.

## License

Apache-2.0. See [`LICENSE`](LICENSE) and [`../../LICENSING.md`](../../LICENSING.md).
You never need a commercial licence for this package.
