omnibias.torch.architectures.integral_kernel
PyTorch activation derivatives, trainable operator layers, network jets, and direct differential-operator contractions.
import omnibias.torch.architectures.integral_kernelModule contract & mathematical conventions
Integral-kernel operator (torch; theory 09-14).
The kernel cell is the OMBU integral role. founding bias collapse
(delta -> 0) of the window is not the default. Temperature
collapse (beta -> inf, feasibility) does not appear. do not
conflate the two.
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 module | Canonical reference |
|---|---|
DISCLAIMER | omnibias.core.integral_kernel.DISCLAIMER |
IntegralKernelConfig | omnibias.core.integral_kernel.IntegralKernelConfig |
honesty_payload | omnibias.core.integral_kernel.honesty_payload |
integral_cell
omnibias.torch.architectures.integral_kernel.integral_cellSource ↗integral_cell(z: Tensor, b_lo: float, b_hi: float) -> TensorS(z + b_hi) - S(z + b_lo). Matches OperatorBlock(op='integral').
Parameters
| Name | Type & default | Contract |
|---|---|---|
zpositional-or-keyword | TensorRequired | See the operation contract and implementation below. |
b_lopositional-or-keyword | floatRequired | See the operation contract and implementation below. |
b_hipositional-or-keyword | floatRequired | See the operation contract and implementation below. |
TensorExecuted regression · g1 matches operator block
Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.
def test_g1_matches_operator_block() -> None:
torch.set_default_dtype(torch.float64)
ex = worked_example()
assert ex["g1_err"] < 1e-12
block = OperatorBlock(op="integral", base="sigmoid", channels=1, init_delta=1.0).double()
z = torch.tensor([[0.5]])
out = float(block(z).detach().reshape(-1)[0])
cell = float(integral_cell(z.reshape(-1), -0.5, 0.5).detach()[0])
assert abs(out - cell) < 1e-12
assert abs(out - core_cell(0.5, -0.5, 0.5)) < 1e-12python -m pytest "packages/omnibias-torch/tests/test_integral_kernel.py::test_g1_matches_operator_block" -qRegression example · g4 bit identical
This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.
def test_g4_bit_identical() -> None:
torch.set_default_dtype(torch.float64)
assert torch_ex()["g1_cell"] == jax_ex()["g1_cell"]
t = float(torch_cell(torch.tensor([0.5]), -0.5, 0.5)[0])
j = float(jax_cell(jnp.asarray([0.5]), -0.5, 0.5)[0])
assert t == jpython -m pytest tests/test_integral_kernel_parity.py -k test_g4_bit_identical -qRead the implementation
def integral_cell(z: Tensor, b_lo: float, b_hi: float) -> Tensor:
"""``S(z + b_hi) - S(z + b_lo)``. Matches ``OperatorBlock(op='integral')``."""
vals = [core.integral_cell(float(v), b_lo, b_hi) for v in z.reshape(-1).tolist()]
return z.new_tensor(vals).reshape(z.shape)integral_kernel_apply
omnibias.torch.architectures.integral_kernel_applySource ↗integral_kernel_apply(source: Tensor, coords: Tensor, params: Sequence[float] | None=None, *, config: IntegralKernelConfig | None=None, nodes: Tensor | None=None) -> TensorVolumetric apply. Not BEM-Net.
Parameters
| Name | Type & default | Contract |
|---|---|---|
sourcepositional-or-keyword | TensorRequired | See the operation contract and implementation below. |
coordspositional-or-keyword | TensorRequired | See the operation contract and implementation below. |
paramspositional-or-keyword | Sequence[float] | NoneDefault: None | See the operation contract and implementation below. |
configkeyword-only | IntegralKernelConfig | NoneDefault: None | See the operation contract and implementation below. |
nodeskeyword-only | Tensor | NoneDefault: None | See the operation contract and implementation below. |
TensorRead the implementation
def integral_kernel_apply(
source: Tensor,
coords: Tensor,
params: Sequence[float] | None = None,
*,
config: IntegralKernelConfig | None = None,
nodes: Tensor | None = None,
) -> Tensor:
"""Volumetric apply. Not BEM-Net."""
src = [float(v) for v in source.reshape(-1).tolist()]
xs = [float(v) for v in coords.reshape(-1).tolist()]
ys = [float(v) for v in nodes.reshape(-1).tolist()] if nodes is not None else None
out = core.integral_kernel_apply(src, xs, params, config=config, nodes=ys)
return coords.new_tensor(out)Other public import paths
omnibias.torch.architectures.integral_kernel_applyomnibias.torch.architectures.integral_kernel.integral_kernel_apply
worked_example
omnibias.torch.architectures.integral_kernel.worked_exampleSource ↗worked_example() -> dict[str, float]The module contract describes the context for this operation. Its signature, explicit validation, return expressions, and implementation are recorded below.
dict[str, float]Executed regression · g1 matches operator block
Recorded coverage confirms this test executed the API body. This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.
def test_g1_matches_operator_block() -> None:
torch.set_default_dtype(torch.float64)
ex = worked_example()
assert ex["g1_err"] < 1e-12
block = OperatorBlock(op="integral", base="sigmoid", channels=1, init_delta=1.0).double()
z = torch.tensor([[0.5]])
out = float(block(z).detach().reshape(-1)[0])
cell = float(integral_cell(z.reshape(-1), -0.5, 0.5).detach()[0])
assert abs(out - cell) < 1e-12
assert abs(out - core_cell(0.5, -0.5, 0.5)) < 1e-12python -m pytest "packages/omnibias-torch/tests/test_integral_kernel.py::test_g1_matches_operator_block" -qRegression example · g4 bit identical
This example belongs to the pinned upstream test suite. It may use fixtures and imports from its full file. Run it from that checkout with its test dependencies installed.
def test_g4_bit_identical() -> None:
torch.set_default_dtype(torch.float64)
assert torch_ex()["g1_cell"] == jax_ex()["g1_cell"]
t = float(torch_cell(torch.tensor([0.5]), -0.5, 0.5)[0])
j = float(jax_cell(jnp.asarray([0.5]), -0.5, 0.5)[0])
assert t == jpython -m pytest tests/test_integral_kernel_parity.py -k test_g4_bit_identical -qRead the implementation
def worked_example() -> dict[str, float]:
return core.worked_example()