Metadata-Version: 2.3
Name: polybake
Version: 0.1.0
Summary: Add your description here
Author: t3tra
Author-email: t3tra <t3tra-dev@users.noreply.github.com>
Requires-Dist: numpy>=2.5.2
Requires-Dist: onnx>=1.22.0
Requires-Dist: onnxruntime>=1.29.0
Requires-Dist: torch>=2.13.0
Requires-Python: >=3.14
Description-Content-Type: text/markdown

# PolyBake

純粋関数によって構成されるプログラムを、**訓練なしに** 意味論を保存または制御された誤差内で近似するニューラル回路へ決定的に変換するコンパイラ。

```python
from polybake import Baker, TensorSpec

baker = Baker()

@baker.collect()
def f(x):
    return max(2 * x + 1, 0)

compiled = baker.bake(inputs=[TensorSpec(shape=(4,), dtype="float32")])
compiled(x)                    # Neural IR を NumPy で実行
compiled.verify()              # 元の Python 関数との差分検査 (note.md §20)
compiled.export_onnx("f.onnx") # ONNX 書き出し
```

近似が要る関数も **入力領域を明示すれば誤差証明書付きで** 変換できる。

```python
from math import exp

@baker.collect()
def gaussian(x):
    return exp(-(x * x))

compiled = baker.bake(inputs=[...], domain=[(-2.0, 2.0)], error=1e-2)
compiled.error_certificate   # -> interval bound<=0.00889 domain=[-2, 2]
```
