Skip to main content

PolyBake

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

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 書き出し

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

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]

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polybake-0.1.0.tar.gz (385.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polybake-0.1.0-py3-none-any.whl (467.6 kB view details)

Uploaded Python 3

File details

Details for the file polybake-0.1.0.tar.gz.

File metadata

  • Download URL: polybake-0.1.0.tar.gz
  • Upload date:
  • Size: 385.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for polybake-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e24faca08ab20e39e9f8639be9cb8b4d2dd440eb165cc586fd4bc03ca9fe140c
MD5 08d0ccd6767dd290b274b1d8b305c598
BLAKE2b-256 d0a9dae50a7cd37c3b1dea3eee3b7190e36ffd432450b0ca4274d76cc08ee339

See more details on using hashes here.

File details

Details for the file polybake-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: polybake-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 467.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for polybake-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a9211b3f78f5f841e15e086e1d91e977b18a1040627933e4918fb720b6c9d67
MD5 1ef7a4d98a1b7f659f0b1705e4c4a1d2
BLAKE2b-256 a6245061a02525c889f8122e903720c6753667468caed6438574f9b43820fb6a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page